ssl/ssl_conf.c:516: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_X509_NAME_new_null()` at line 513, column 25 is not reachable after line 516, column 12.
Showing all 49 steps of the trace


ssl/ssl_conf.c:510:1: start of procedure cmd_ClientCAFile()
508.   }
509.   
510. > static int cmd_ClientCAFile(SSL_CONF_CTX *cctx, const char *value)
511.   {
512.       if (cctx->canames == NULL)

ssl/ssl_conf.c:512:9: Taking true branch
510.   static int cmd_ClientCAFile(SSL_CONF_CTX *cctx, const char *value)
511.   {
512.       if (cctx->canames == NULL)
               ^
513.           cctx->canames = sk_X509_NAME_new_null();
514.       if (cctx->canames == NULL)

ssl/ssl_conf.c:513:9: 
511.   {
512.       if (cctx->canames == NULL)
513. >         cctx->canames = sk_X509_NAME_new_null();
514.       if (cctx->canames == NULL)
515.           return 0;

include/openssl/x509.h:147:1: start of procedure sk_X509_NAME_new_null()
  145.   DEFINE_STACK_OF(X509_NAME_ENTRY)
  146.   
  147. > DEFINE_STACK_OF(X509_NAME)
  148.   
  149.   # define X509_EX_V_NETSCAPE_HACK         0x8000

crypto/stack/stack.c:144:1: start of procedure sk_new_null()
    142.   }
    143.   
    144. > _STACK *sk_new_null(void)
    145.   {
    146.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:146:5: 
    144.   _STACK *sk_new_null(void)
    145.   {
    146. >     return sk_new((int (*)(const void *, const void *))0);
    147.   }
    148.   

crypto/stack/stack.c:149:1: start of procedure sk_new()
      147.   }
      148.   
      149. > _STACK *sk_new(int (*c) (const void *, const void *))
      150.   {
      151.       _STACK *ret;

crypto/stack/stack.c:153:9: 
      151.       _STACK *ret;
      152.   
      153. >     if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      154.           goto err;
      155.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
        154.   }
        155.   
        156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
        157.   {
        158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
        156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
        157.   {
        158. >     void *ret = CRYPTO_malloc(num, file, line);
        159.   
        160.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
          117.   }
          118.   
          119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
          120.   {
          121.       void *ret = NULL;

crypto/mem.c:121:5: 
          119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
          120.   {
          121. >     void *ret = NULL;
          122.   
          123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
          121.       void *ret = NULL;
          122.   
          123.       if (num <= 0)
                         ^
          124.           return NULL;
          125.   

crypto/mem.c:126:5: 
          124.           return NULL;
          125.   
          126. >     allow_customize = 0;
          127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
          128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
          134.       }
          135.   #else
          136. >     (void)file;
          137.       (void)line;
          138.       ret = malloc(num);

crypto/mem.c:137:5: 
          135.   #else
          136.       (void)file;
          137. >     (void)line;
          138.       ret = malloc(num);
          139.   #endif

crypto/mem.c:138:5: 
          136.       (void)file;
          137.       (void)line;
          138. >     ret = malloc(num);
          139.   #endif
          140.   

crypto/mem.c:153:5: 
          151.   #endif
          152.   
          153. >     return ret;
          154.   }
          155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
          152.   
          153.       return ret;
          154. > }
          155.   
          156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:160:9: Taking true branch
        158.       void *ret = CRYPTO_malloc(num, file, line);
        159.   
        160.       if (ret != NULL)
                       ^
        161.           memset(ret, 0, num);
        162.       return ret;

crypto/mem.c:161:9: 
        159.   
        160.       if (ret != NULL)
        161. >         memset(ret, 0, num);
        162.       return ret;
        163.   }

crypto/mem.c:162:5: 
        160.       if (ret != NULL)
        161.           memset(ret, 0, num);
        162. >     return ret;
        163.   }
        164.   

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
        161.           memset(ret, 0, num);
        162.       return ret;
        163. > }
        164.   
        165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:153:9: Taking false branch
      151.       _STACK *ret;
      152.   
      153.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
                     ^
      154.           goto err;
      155.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/stack/stack.c:155:9: 
      153.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      154.           goto err;
      155. >     if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
      156.           goto err;
      157.       ret->comp = c;

crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
        154.   }
        155.   
        156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
        157.   {
        158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
        156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
        157.   {
        158. >     void *ret = CRYPTO_malloc(num, file, line);
        159.   
        160.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
          117.   }
          118.   
          119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
          120.   {
          121.       void *ret = NULL;

crypto/mem.c:121:5: 
          119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
          120.   {
          121. >     void *ret = NULL;
          122.   
          123.       if (num <= 0)

crypto/mem.c:123:9: Taking false branch
          121.       void *ret = NULL;
          122.   
          123.       if (num <= 0)
                         ^
          124.           return NULL;
          125.   

crypto/mem.c:126:5: 
          124.           return NULL;
          125.   
          126. >     allow_customize = 0;
          127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
          128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
          134.       }
          135.   #else
          136. >     (void)file;
          137.       (void)line;
          138.       ret = malloc(num);

crypto/mem.c:137:5: 
          135.   #else
          136.       (void)file;
          137. >     (void)line;
          138.       ret = malloc(num);
          139.   #endif

crypto/mem.c:138:5: 
          136.       (void)file;
          137.       (void)line;
          138. >     ret = malloc(num);
          139.   #endif
          140.   

crypto/mem.c:153:5: 
          151.   #endif
          152.   
          153. >     return ret;
          154.   }
          155.   

crypto/mem.c:154:1: return from a call to CRYPTO_malloc
          152.   
          153.       return ret;
          154. > }
          155.   
          156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:160:9: Taking true branch
        158.       void *ret = CRYPTO_malloc(num, file, line);
        159.   
        160.       if (ret != NULL)
                       ^
        161.           memset(ret, 0, num);
        162.       return ret;

crypto/mem.c:161:9: 
        159.   
        160.       if (ret != NULL)
        161. >         memset(ret, 0, num);
        162.       return ret;
        163.   }

crypto/mem.c:162:5: 
        160.       if (ret != NULL)
        161.           memset(ret, 0, num);
        162. >     return ret;
        163.   }
        164.   

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
        161.           memset(ret, 0, num);
        162.       return ret;
        163. > }
        164.   
        165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:155:9: Taking false branch
      153.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      154.           goto err;
      155.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
                     ^
      156.           goto err;
      157.       ret->comp = c;

crypto/stack/stack.c:157:5: 
      155.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
      156.           goto err;
      157. >     ret->comp = c;
      158.       ret->num_alloc = MIN_NODES;
      159.       return (ret);

crypto/stack/stack.c:158:5: 
      156.           goto err;
      157.       ret->comp = c;
      158. >     ret->num_alloc = MIN_NODES;
      159.       return (ret);
      160.   

crypto/stack/stack.c:159:5: 
      157.       ret->comp = c;
      158.       ret->num_alloc = MIN_NODES;
      159. >     return (ret);
      160.   
      161.    err:

crypto/stack/stack.c:164:1: return from a call to sk_new
      162.       OPENSSL_free(ret);
      163.       return (NULL);
      164. > }
      165.   
      166.   int sk_insert(_STACK *st, void *data, int loc)

crypto/stack/stack.c:147:1: return from a call to sk_new_null
    145.   {
    146.       return sk_new((int (*)(const void *, const void *))0);
    147. > }
    148.   
    149.   _STACK *sk_new(int (*c) (const void *, const void *))

include/openssl/x509.h:147:1: return from a call to sk_X509_NAME_new_null
  145.   DEFINE_STACK_OF(X509_NAME_ENTRY)
  146.   
  147. > DEFINE_STACK_OF(X509_NAME)
  148.   
  149.   # define X509_EX_V_NETSCAPE_HACK         0x8000

ssl/ssl_conf.c:514:9: Taking false branch
512.       if (cctx->canames == NULL)
513.           cctx->canames = sk_X509_NAME_new_null();
514.       if (cctx->canames == NULL)
               ^
515.           return 0;
516.       return SSL_add_file_cert_subjects_to_stack(cctx->canames, value);

ssl/ssl_conf.c:516:5: Skipping SSL_add_file_cert_subjects_to_stack(): empty list of specs
514.       if (cctx->canames == NULL)
515.           return 0;
516.       return SSL_add_file_cert_subjects_to_stack(cctx->canames, value);
           ^
517.   }
518.   

static int cmd_ClientCAFile(SSL_CONF_CTX *cctx, const char *value)
{
    if (cctx->canames == NULL)
        cctx->canames = sk_X509_NAME_new_null();
    if (cctx->canames == NULL)
        return 0;
    return SSL_add_file_cert_subjects_to_stack(cctx->canames, value);
}
['static int cmd_ClientCAFile(SSL_CONF_CTX *cctx, const char *value)\n{\n    if (cctx->canames == NULL)\n        cctx->canames = sk_X509_NAME_new_null();\n    if (cctx->canames == NULL)\n        return 0;\n    return SSL_add_file_cert_subjects_to_stack(cctx->canames, value);\n}', '_STACK *sk_new_null(void)\n{\n    return sk_new((int (*)(const void *, const void *))0);\n}', '_STACK *sk_new(int (*c) (const void *, const void *))\n{\n    _STACK *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)\n        goto err;\n    if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)\n        goto err;\n    ret->comp = c;\n    ret->num_alloc = MIN_NODES;\n    return (ret);\n err:\n    OPENSSL_free(ret);\n    return (NULL);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}']