crypto/store/store_register.c:47: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 33, column 30 is not reachable after line 47, column 9.
Showing all 21 steps of the trace


crypto/store/store_register.c:31:1: start of procedure OSSL_STORE_LOADER_new()
29.    */
30.   
31. > OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(const char *scheme)
32.   {
33.       OSSL_STORE_LOADER *res = OPENSSL_zalloc(sizeof(*res));

crypto/store/store_register.c:33:5: 
31.   OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(const char *scheme)
32.   {
33. >     OSSL_STORE_LOADER *res = OPENSSL_zalloc(sizeof(*res));
34.   
35.       if (res == NULL) {

crypto/mem.c:194:1: start of procedure CRYPTO_zalloc()
  192.   }
  193.   
  194. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  195.   {
  196.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:196:5: 
  194.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  195.   {
  196. >     void *ret = CRYPTO_malloc(num, file, line);
  197.   
  198.       FAILTEST();

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

crypto/mem.c:168:5: 
    166.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    167.   {
    168. >     void *ret = NULL;
    169.   
    170.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:170:9: Taking false branch
    168.       void *ret = NULL;
    169.   
    170.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    171.           return malloc_impl(num, file, line);
    172.   

crypto/mem.c:173:9: Taking false branch
    171.           return malloc_impl(num, file, line);
    172.   
    173.       if (num == 0)
                   ^
    174.           return NULL;
    175.   

crypto/mem.c:177:5: 
    175.   
    176.       FAILTEST();
    177. >     allow_customize = 0;
    178.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    179.       if (call_malloc_debug) {

crypto/mem.c:187:5: 
    185.       }
    186.   #else
    187. >     osslargused(file); osslargused(line);
    188.       ret = malloc(num);
    189.   #endif

crypto/mem.c:187:24: 
    185.       }
    186.   #else
    187. >     osslargused(file); osslargused(line);
    188.       ret = malloc(num);
    189.   #endif

crypto/mem.c:188:5: 
    186.   #else
    187.       osslargused(file); osslargused(line);
    188. >     ret = malloc(num);
    189.   #endif
    190.   

crypto/mem.c:191:5: 
    189.   #endif
    190.   
    191. >     return ret;
    192.   }
    193.   

crypto/mem.c:192:1: return from a call to CRYPTO_malloc
    190.   
    191.       return ret;
    192. > }
    193.   
    194.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:199:9: Taking true branch
  197.   
  198.       FAILTEST();
  199.       if (ret != NULL)
                 ^
  200.           memset(ret, 0, num);
  201.       return ret;

crypto/mem.c:200:9: 
  198.       FAILTEST();
  199.       if (ret != NULL)
  200. >         memset(ret, 0, num);
  201.       return ret;
  202.   }

crypto/mem.c:201:5: 
  199.       if (ret != NULL)
  200.           memset(ret, 0, num);
  201. >     return ret;
  202.   }
  203.   

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

crypto/store/store_register.c:35:9: Taking false branch
33.       OSSL_STORE_LOADER *res = OPENSSL_zalloc(sizeof(*res));
34.   
35.       if (res == NULL) {
              ^
36.           OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW, ERR_R_MALLOC_FAILURE);
37.           return NULL;

crypto/store/store_register.c:46:9: Taking true branch
44.        * later on.
45.        */
46.       if (scheme == NULL) {
              ^
47.           OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW,
48.                         OSSL_STORE_R_INVALID_SCHEME);

crypto/store/store_register.c:47:9: Skipping ERR_put_error(): empty list of specs
45.        */
46.       if (scheme == NULL) {
47.           OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW,
              ^
48.                         OSSL_STORE_R_INVALID_SCHEME);
49.           return NULL;

OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(const char *scheme)
{
    OSSL_STORE_LOADER *res = OPENSSL_zalloc(sizeof(*res));
    if (res == NULL) {
        OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW, ERR_R_MALLOC_FAILURE);
        return NULL;
    }
    if (scheme == NULL) {
        OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW,
                      OSSL_STORE_R_INVALID_SCHEME);
        return NULL;
    }
    res->scheme = scheme;
    return res;
}
['OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(const char *scheme)\n{\n    OSSL_STORE_LOADER *res = OPENSSL_zalloc(sizeof(*res));\n    if (res == NULL) {\n        OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    if (scheme == NULL) {\n        OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_LOADER_NEW,\n                      OSSL_STORE_R_INVALID_SCHEME);\n        return NULL;\n    }\n    res->scheme = scheme;\n    return res;\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_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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}']