#159 memory leak fix in TPM engine

Bug
closed-fixed
Kent Yoder
5
2012-09-19
2012-09-01
Roland Osborne
No

I saw a memory leak in the TPM engine when doing many OpenSSL connections.
This change resolved the issue for me:

Index: src/e_tpm.c

--- src/e_tpm.c (revision 18949)
+++ src/e_tpm.c (working copy)
@@ -850,6 +850,18 @@

DBG("%s", __FUNCTION__);

+ if(app_data != NULL && app_data->hHash != NULL_HHASH)
+ {
+ p_tspi_Context_CloseObject(hContext, app_data->hHash);
+ app_data->hHash = NULL_HHASH;
+ }
+
+ if(app_data != NULL && app_data->hKey != NULL_HKEY)
+ {
+ p_tspi_Context_CloseObject(hContext, app_data->hKey);
+ app_data->hKey = NULL_HKEY;
+ }
+
OPENSSL_free(app_data);

return 1;

Discussion

  • Kent Yoder
    Kent Yoder
    2012-09-05

    • assigned_to: phreakz --> kyoder
     
  • Kent Yoder
    Kent Yoder
    2012-09-11

    Hi Roland, if you'd like me to attribute you as author for the patch, please post it to the trousers-tech mailing list with a Signed-off-by: <email> line. Otherwise I'll apply unattributed.

    Thanks for the fix!

    Kent

     
  • Roland Osborne
    Roland Osborne
    2012-09-11

    thanks! i sent an email to the trousers-tech list.
    -Roland

     
  • Kent Yoder
    Kent Yoder
    2012-09-19

    Fixed in git commit 9c5bb76d09895cd139aa5ec4af7f22d0a07236b4

     
  • Kent Yoder
    Kent Yoder
    2012-09-19

    • status: open --> closed-fixed
     
  • Kent Yoder
    Kent Yoder
    2012-09-19

    Fixed in git commit 94a256160b9ce5c42ca6246722796ba71c695866