Fix two possible leaks.
authorFdaSilvaYY <fdasilvayy@gmail.com>
Thu, 21 Jan 2016 22:10:29 +0000 (23:10 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Sat, 23 Jan 2016 23:47:41 +0000 (00:47 +0100)
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #580

crypto/dso/dso_lib.c
crypto/engine/eng_dyn.c

index cc29ca4e4d93bde1b4c22dfc8b3d302a10e36112..dfa738aa0a7e812a168a4bcc9eea299fc41ee4a4 100644 (file)
@@ -122,6 +122,7 @@ DSO *DSO_new_method(DSO_METHOD *meth)
         ret->meth = meth;
     ret->references = 1;
     if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
+        sk_void_free(ret->meth_data);
         OPENSSL_free(ret);
         ret = NULL;
     }
index d19cab2ecf84d442bd2b8f6515d81ef2f00c315b..bdd0a1aeb6d0b351a489900de28d105b023b4696 100644 (file)
@@ -231,6 +231,8 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
      * If we lost the race to set the context, c is non-NULL and *ctx is the
      * context of the thread that won.
      */
+    if (c)
+        sk_OPENSSL_STRING_free(c->dirs);
     OPENSSL_free(c);
     return 1;
 }