[openssl] master update

Matt Caswell matt at openssl.org
Fri Nov 15 11:16:10 UTC 2019


The branch master has been updated
       via  93863030867ad0331bf7f199f8a266ad99ee4cf2 (commit)
      from  985412f8c14853b9936852bc7ef4d9438db27b88 (commit)


- Log -----------------------------------------------------------------
commit 93863030867ad0331bf7f199f8a266ad99ee4cf2
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Nov 12 17:37:11 2019 +0000

    Make sure we free the CONF structure allocated by confdump
    
    A travis build was failing because of a memory leak in confdump due to
    us not freeing an allocated CONF structure.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/10429)

-----------------------------------------------------------------------

Summary of changes:
 test/confdump.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/test/confdump.c b/test/confdump.c
index b83119ef34..dbf6244653 100644
--- a/test/confdump.c
+++ b/test/confdump.c
@@ -51,10 +51,10 @@ static void dump_section(const char *name, const CONF *cnf)
 int main(int argc, char **argv)
 {
     long eline;
-    CONF *conf;
+    CONF *conf = NCONF_new(NCONF_default());
+    int ret = 1;
 
-    if ((conf = NCONF_new(NCONF_default())) != NULL
-        && NCONF_load(conf, argv[1], &eline)) {
+    if (conf != NULL && NCONF_load(conf, argv[1], &eline)) {
         int i;
 
         collect_all_sections(conf);
@@ -62,9 +62,10 @@ int main(int argc, char **argv)
             dump_section(sk_OPENSSL_CSTRING_value(section_names, i), conf);
         }
         sk_OPENSSL_CSTRING_free(section_names);
+        ret = 0;
     } else {
         ERR_print_errors_fp(stderr);
-        return 1;
     }
-    return 0;
+    NCONF_free(conf);
+    return ret;
 }


More information about the openssl-commits mailing list