crypto/srp/srp_vfy.c:144: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_SRP_user_pwd_new_null()` at line 142, column 26 is not reachable after line 144, column 9.
Showing all 59 steps of the trace


crypto/srp/srp_vfy.c:136:1: start of procedure SRP_VBASE_new()
134.   }
135.   
136. > SRP_VBASE *SRP_VBASE_new(char *seed_key)
137.   {
138.       SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb));

crypto/srp/srp_vfy.c:138:5: 
136.   SRP_VBASE *SRP_VBASE_new(char *seed_key)
137.   {
138. >     SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb));
139.   
140.       if (vb == NULL)

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
  187.   #endif
  188.   
  189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  190.   {
  191.       void *ret = NULL;

crypto/mem.c:191:5: 
  189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  190.   {
  191. >     void *ret = NULL;
  192.   
  193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
  192.   
  193.       INCREMENT(malloc_count);
  194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  195.           return malloc_impl(num, file, line);
  196.   

crypto/mem.c:197:9: Taking false branch
  195.           return malloc_impl(num, file, line);
  196.   
  197.       if (num == 0)
                 ^
  198.           return NULL;
  199.   

crypto/mem.c:201:5: 
  199.   
  200.       FAILTEST();
  201. >     allow_customize = 0;
  202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
  209.       }
  210.   #else
  211. >     (void)(file); (void)(line);
  212.       ret = malloc(num);
  213.   #endif

crypto/mem.c:211:19: 
  209.       }
  210.   #else
  211. >     (void)(file); (void)(line);
  212.       ret = malloc(num);
  213.   #endif

crypto/mem.c:212:5: 
  210.   #else
  211.       (void)(file); (void)(line);
  212. >     ret = malloc(num);
  213.   #endif
  214.   

crypto/mem.c:215:5: 
  213.   #endif
  214.   
  215. >     return ret;
  216.   }
  217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
  214.   
  215.       return ret;
  216. > }
  217.   
  218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/srp/srp_vfy.c:140:9: Taking false branch
138.       SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb));
139.   
140.       if (vb == NULL)
               ^
141.           return NULL;
142.       if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL

crypto/srp/srp_vfy.c:142:9: 
140.       if (vb == NULL)
141.           return NULL;
142. >     if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL
143.           || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {
144.           OPENSSL_free(vb);

include/openssl/srp.h:48:1: start of procedure sk_SRP_user_pwd_new_null()
  46.   void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
  47.   
  48. > DEFINE_STACK_OF(SRP_user_pwd)
  49.   
  50.   typedef struct SRP_VBASE_st {

crypto/stack/stack.c:112:1: start of procedure OPENSSL_sk_new_null()
    110.   }
    111.   
    112. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:114:5: 
    112.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    115.   }
    116.   

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
      216.   }
      217.   
      218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      219.   {
      220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
      218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      219.   {
      220. >     void *ret = CRYPTO_malloc(num, file, line);
      221.   
      222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
        187.   #endif
        188.   
        189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        190.   {
        191.       void *ret = NULL;

crypto/mem.c:191:5: 
        189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        190.   {
        191. >     void *ret = NULL;
        192.   
        193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
        192.   
        193.       INCREMENT(malloc_count);
        194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        195.           return malloc_impl(num, file, line);
        196.   

crypto/mem.c:197:9: Taking false branch
        195.           return malloc_impl(num, file, line);
        196.   
        197.       if (num == 0)
                       ^
        198.           return NULL;
        199.   

crypto/mem.c:201:5: 
        199.   
        200.       FAILTEST();
        201. >     allow_customize = 0;
        202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
        209.       }
        210.   #else
        211. >     (void)(file); (void)(line);
        212.       ret = malloc(num);
        213.   #endif

crypto/mem.c:211:19: 
        209.       }
        210.   #else
        211. >     (void)(file); (void)(line);
        212.       ret = malloc(num);
        213.   #endif

crypto/mem.c:212:5: 
        210.   #else
        211.       (void)(file); (void)(line);
        212. >     ret = malloc(num);
        213.   #endif
        214.   

crypto/mem.c:215:5: 
        213.   #endif
        214.   
        215. >     return ret;
        216.   }
        217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
        214.   
        215.       return ret;
        216. > }
        217.   
        218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking true branch
      221.   
      222.       FAILTEST();
      223.       if (ret != NULL)
                     ^
      224.           memset(ret, 0, num);
      225.       return ret;

crypto/mem.c:224:9: 
      222.       FAILTEST();
      223.       if (ret != NULL)
      224. >         memset(ret, 0, num);
      225.       return ret;
      226.   }

crypto/mem.c:225:5: 
      223.       if (ret != NULL)
      224.           memset(ret, 0, num);
      225. >     return ret;
      226.   }
      227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
      224.           memset(ret, 0, num);
      225.       return ret;
      226. > }
      227.   
      228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:115:1: return from a call to OPENSSL_sk_new_null
    113.   {
    114.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    115. > }
    116.   
    117.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

include/openssl/srp.h:48:1: return from a call to sk_SRP_user_pwd_new_null
  46.   void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
  47.   
  48. > DEFINE_STACK_OF(SRP_user_pwd)
  49.   
  50.   typedef struct SRP_VBASE_st {

crypto/srp/srp_vfy.c:142:9: Taking false branch
140.       if (vb == NULL)
141.           return NULL;
142.       if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL
               ^
143.           || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {
144.           OPENSSL_free(vb);

crypto/srp/srp_vfy.c:143:12: 
141.           return NULL;
142.       if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL
143. >         || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {
144.           OPENSSL_free(vb);
145.           return NULL;

include/openssl/srp.h:32:1: start of procedure sk_SRP_gN_cache_new_null()
  30.   
  31.   
  32. > DEFINE_STACK_OF(SRP_gN_cache)
  33.   
  34.   typedef struct SRP_user_pwd_st {

crypto/stack/stack.c:112:1: start of procedure OPENSSL_sk_new_null()
    110.   }
    111.   
    112. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:114:5: 
    112.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    115.   }
    116.   

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
      216.   }
      217.   
      218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      219.   {
      220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
      218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      219.   {
      220. >     void *ret = CRYPTO_malloc(num, file, line);
      221.   
      222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
        187.   #endif
        188.   
        189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        190.   {
        191.       void *ret = NULL;

crypto/mem.c:191:5: 
        189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        190.   {
        191. >     void *ret = NULL;
        192.   
        193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking true branch
        192.   
        193.       INCREMENT(malloc_count);
        194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        195.           return malloc_impl(num, file, line);
        196.   

crypto/mem.c:194:32: Taking true branch
        192.   
        193.       INCREMENT(malloc_count);
        194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                              ^
        195.           return malloc_impl(num, file, line);
        196.   

crypto/mem.c:195:9: Skipping __function_pointer__(): unresolved function pointer
        193.       INCREMENT(malloc_count);
        194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
        195.           return malloc_impl(num, file, line);
                       ^
        196.   
        197.       if (num == 0)

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
        214.   
        215.       return ret;
        216. > }
        217.   
        218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking false branch
      221.   
      222.       FAILTEST();
      223.       if (ret != NULL)
                     ^
      224.           memset(ret, 0, num);
      225.       return ret;

crypto/mem.c:225:5: 
      223.       if (ret != NULL)
      224.           memset(ret, 0, num);
      225. >     return ret;
      226.   }
      227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
      224.           memset(ret, 0, num);
      225.       return ret;
      226. > }
      227.   
      228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:115:1: return from a call to OPENSSL_sk_new_null
    113.   {
    114.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    115. > }
    116.   
    117.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

include/openssl/srp.h:32:1: return from a call to sk_SRP_gN_cache_new_null
  30.   
  31.   
  32. > DEFINE_STACK_OF(SRP_gN_cache)
  33.   
  34.   typedef struct SRP_user_pwd_st {

crypto/srp/srp_vfy.c:143:12: Taking true branch
141.           return NULL;
142.       if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL
143.           || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {
                  ^
144.           OPENSSL_free(vb);
145.           return NULL;

crypto/srp/srp_vfy.c:144:9: 
142.       if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL
143.           || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {
144. >         OPENSSL_free(vb);
145.           return NULL;
146.       }

crypto/mem.c:286:1: start of procedure CRYPTO_free()
  284.   }
  285.   
  286. > void CRYPTO_free(void *str, const char *file, int line)
  287.   {
  288.       INCREMENT(free_count);

crypto/mem.c:289:9: Taking false branch
  287.   {
  288.       INCREMENT(free_count);
  289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  290.           free_impl(str, file, line);
  291.           return;

crypto/mem.c:303:5: 
  301.       }
  302.   #else
  303. >     free(str);
  304.   #endif
  305.   }

crypto/mem.c:305:1: return from a call to CRYPTO_free
  303.       free(str);
  304.   #endif
  305. > }
  306.   
  307.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

SRP_VBASE *SRP_VBASE_new(char *seed_key)
{
    SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb));
    if (vb == NULL)
        return NULL;
    if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL
        || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {
        OPENSSL_free(vb);
        return NULL;
    }
    vb->default_g = NULL;
    vb->default_N = NULL;
    vb->seed_key = NULL;
    if ((seed_key != NULL) && (vb->seed_key = OPENSSL_strdup(seed_key)) == NULL) {
        sk_SRP_user_pwd_free(vb->users_pwd);
        sk_SRP_gN_cache_free(vb->gN_cache);
        OPENSSL_free(vb);
        return NULL;
    }
    return vb;
}
['SRP_VBASE *SRP_VBASE_new(char *seed_key)\n{\n    SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb));\n    if (vb == NULL)\n        return NULL;\n    if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL\n        || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) {\n        OPENSSL_free(vb);\n        return NULL;\n    }\n    vb->default_g = NULL;\n    vb->default_N = NULL;\n    vb->seed_key = NULL;\n    if ((seed_key != NULL) && (vb->seed_key = OPENSSL_strdup(seed_key)) == NULL) {\n        sk_SRP_user_pwd_free(vb->users_pwd);\n        sk_SRP_gN_cache_free(vb->gN_cache);\n        OPENSSL_free(vb);\n        return NULL;\n    }\n    return vb;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    INCREMENT(malloc_count);\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\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); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'OPENSSL_STACK *OPENSSL_sk_new_null(void)\n{\n    return OPENSSL_zalloc(sizeof(OPENSSL_STACK));\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    FAILTEST();\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    INCREMENT(free_count);\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']