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:170:1: start of procedure CRYPTO_malloc()
  168.   #endif
  169.   
  170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  171.   {
  172.       void *ret = NULL;

crypto/mem.c:172:5: 
  170.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  171.   {
  172. >     void *ret = NULL;
  173.   
  174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:174:9: Taking false branch
  172.       void *ret = NULL;
  173.   
  174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  175.           return malloc_impl(num, file, line);
  176.   

crypto/mem.c:177:9: Taking false branch
  175.           return malloc_impl(num, file, line);
  176.   
  177.       if (num == 0)
                 ^
  178.           return NULL;
  179.   

crypto/mem.c:181:5: 
  179.   
  180.       FAILTEST();
  181. >     allow_customize = 0;
  182.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  183.       if (call_malloc_debug) {

crypto/mem.c:191:5: 
  189.       }
  190.   #else
  191. >     (void)(file); (void)(line);
  192.       ret = malloc(num);
  193.   #endif

crypto/mem.c:191:19: 
  189.       }
  190.   #else
  191. >     (void)(file); (void)(line);
  192.       ret = malloc(num);
  193.   #endif

crypto/mem.c:192:5: 
  190.   #else
  191.       (void)(file); (void)(line);
  192. >     ret = malloc(num);
  193.   #endif
  194.   

crypto/mem.c:195:5: 
  193.   #endif
  194.   
  195. >     return ret;
  196.   }
  197.   

crypto/mem.c:196:1: return from a call to CRYPTO_malloc
  194.   
  195.       return ret;
  196. > }
  197.   
  198.   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:118:1: start of procedure OPENSSL_sk_new_null()
    116.   }
    117.   
    118. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:120:5: 
    118.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121.   }
    122.   

crypto/mem.c:198:1: start of procedure CRYPTO_zalloc()
      196.   }
      197.   
      198. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:200:5: 
      198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200. >     void *ret = CRYPTO_malloc(num, file, line);
      201.   
      202.       FAILTEST();

crypto/mem.c:170:1: start of procedure CRYPTO_malloc()
        168.   #endif
        169.   
        170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172.       void *ret = NULL;

crypto/mem.c:172:5: 
        170.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172. >     void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:174:9: Taking false branch
        172.       void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        175.           return malloc_impl(num, file, line);
        176.   

crypto/mem.c:177:9: Taking false branch
        175.           return malloc_impl(num, file, line);
        176.   
        177.       if (num == 0)
                       ^
        178.           return NULL;
        179.   

crypto/mem.c:181:5: 
        179.   
        180.       FAILTEST();
        181. >     allow_customize = 0;
        182.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        183.       if (call_malloc_debug) {

crypto/mem.c:191:5: 
        189.       }
        190.   #else
        191. >     (void)(file); (void)(line);
        192.       ret = malloc(num);
        193.   #endif

crypto/mem.c:191:19: 
        189.       }
        190.   #else
        191. >     (void)(file); (void)(line);
        192.       ret = malloc(num);
        193.   #endif

crypto/mem.c:192:5: 
        190.   #else
        191.       (void)(file); (void)(line);
        192. >     ret = malloc(num);
        193.   #endif
        194.   

crypto/mem.c:195:5: 
        193.   #endif
        194.   
        195. >     return ret;
        196.   }
        197.   

crypto/mem.c:196:1: return from a call to CRYPTO_malloc
        194.   
        195.       return ret;
        196. > }
        197.   
        198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:203:9: Taking true branch
      201.   
      202.       FAILTEST();
      203.       if (ret != NULL)
                     ^
      204.           memset(ret, 0, num);
      205.       return ret;

crypto/mem.c:204:9: 
      202.       FAILTEST();
      203.       if (ret != NULL)
      204. >         memset(ret, 0, num);
      205.       return ret;
      206.   }

crypto/mem.c:205:5: 
      203.       if (ret != NULL)
      204.           memset(ret, 0, num);
      205. >     return ret;
      206.   }
      207.   

crypto/mem.c:206:1: return from a call to CRYPTO_zalloc
      204.           memset(ret, 0, num);
      205.       return ret;
      206. > }
      207.   
      208.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:121:1: return from a call to OPENSSL_sk_new_null
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121. > }
    122.   
    123.   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:118:1: start of procedure OPENSSL_sk_new_null()
    116.   }
    117.   
    118. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:120:5: 
    118.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121.   }
    122.   

crypto/mem.c:198:1: start of procedure CRYPTO_zalloc()
      196.   }
      197.   
      198. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:200:5: 
      198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200. >     void *ret = CRYPTO_malloc(num, file, line);
      201.   
      202.       FAILTEST();

crypto/mem.c:170:1: start of procedure CRYPTO_malloc()
        168.   #endif
        169.   
        170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172.       void *ret = NULL;

crypto/mem.c:172:5: 
        170.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172. >     void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:174:9: Taking true branch
        172.       void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        175.           return malloc_impl(num, file, line);
        176.   

crypto/mem.c:174:32: Taking true branch
        172.       void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                              ^
        175.           return malloc_impl(num, file, line);
        176.   

crypto/mem.c:175:9: Skipping __function_pointer__(): unresolved function pointer
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
        175.           return malloc_impl(num, file, line);
                       ^
        176.   
        177.       if (num == 0)

crypto/mem.c:196:1: return from a call to CRYPTO_malloc
        194.   
        195.       return ret;
        196. > }
        197.   
        198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:203:9: Taking false branch
      201.   
      202.       FAILTEST();
      203.       if (ret != NULL)
                     ^
      204.           memset(ret, 0, num);
      205.       return ret;

crypto/mem.c:205:5: 
      203.       if (ret != NULL)
      204.           memset(ret, 0, num);
      205. >     return ret;
      206.   }
      207.   

crypto/mem.c:206:1: return from a call to CRYPTO_zalloc
      204.           memset(ret, 0, num);
      205.       return ret;
      206. > }
      207.   
      208.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:121:1: return from a call to OPENSSL_sk_new_null
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121. > }
    122.   
    123.   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:265:1: start of procedure CRYPTO_free()
  263.   }
  264.   
  265. > void CRYPTO_free(void *str, const char *file, int line)
  266.   {
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:267:9: Taking false branch
  265.   void CRYPTO_free(void *str, const char *file, int line)
  266.   {
  267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  268.           free_impl(str, file, line);
  269.           return;

crypto/mem.c:281:5: 
  279.       }
  280.   #else
  281. >     free(str);
  282.   #endif
  283.   }

crypto/mem.c:283:1: return from a call to CRYPTO_free
  281.       free(str);
  282.   #endif
  283. > }
  284.   
  285.   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    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    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}']