crypto/objects/obj_xref.c:118: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 106, column 11 is not reachable after line 118, column 10.
Showing all 39 steps of the trace


crypto/objects/obj_xref.c:95:1: start of procedure OBJ_add_sigid()
93.   }
94.   
95. > int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
96.   {
97.       nid_triple *ntr;

crypto/objects/obj_xref.c:98:9: Taking true branch
96.   {
97.       nid_triple *ntr;
98.       if (sig_app == NULL)
               ^
99.           sig_app = sk_nid_triple_new(sig_sk_cmp);
100.       if (sig_app == NULL)

crypto/objects/obj_xref.c:99:9: 
97.       nid_triple *ntr;
98.       if (sig_app == NULL)
99. >         sig_app = sk_nid_triple_new(sig_sk_cmp);
100.       if (sig_app == NULL)
101.           return 0;

crypto/objects/obj_xref.h:20:1: start of procedure sk_nid_triple_new()
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.h:20:1: return from a call to sk_nid_triple_new
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.c:100:9: Taking false branch
98.       if (sig_app == NULL)
99.           sig_app = sk_nid_triple_new(sig_sk_cmp);
100.       if (sig_app == NULL)
               ^
101.           return 0;
102.       if (sigx_app == NULL)

crypto/objects/obj_xref.c:102:9: Taking true branch
100.       if (sig_app == NULL)
101.           return 0;
102.       if (sigx_app == NULL)
               ^
103.           sigx_app = sk_nid_triple_new(sigx_cmp);
104.       if (sigx_app == NULL)

crypto/objects/obj_xref.c:103:9: 
101.           return 0;
102.       if (sigx_app == NULL)
103. >         sigx_app = sk_nid_triple_new(sigx_cmp);
104.       if (sigx_app == NULL)
105.           return 0;

crypto/objects/obj_xref.h:20:1: start of procedure sk_nid_triple_new()
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.h:20:1: return from a call to sk_nid_triple_new
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.c:104:9: Taking false branch
102.       if (sigx_app == NULL)
103.           sigx_app = sk_nid_triple_new(sigx_cmp);
104.       if (sigx_app == NULL)
               ^
105.           return 0;
106.       ntr = OPENSSL_malloc(sizeof(*ntr));

crypto/objects/obj_xref.c:106:5: 
104.       if (sigx_app == NULL)
105.           return 0;
106. >     ntr = OPENSSL_malloc(sizeof(*ntr));
107.       if (ntr == NULL)
108.           return 0;

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
  69.   }
  70.   
  71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73.       void *ret = NULL;

crypto/mem.c:73:5: 
  71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73. >     void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:78:9: Taking false branch
  76.           return malloc_impl(num, file, line);
  77.   
  78.       if (num <= 0)
                ^
  79.           return NULL;
  80.   

crypto/mem.c:81:5: 
  79.           return NULL;
  80.   
  81. >     allow_customize = 0;
  82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:91:24: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:92:5: 
  90.   #else
  91.       osslargused(file); osslargused(line);
  92. >     ret = malloc(num);
  93.   #endif
  94.   

crypto/mem.c:95:5: 
  93.   #endif
  94.   
  95. >     return ret;
  96.   }
  97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
  94.   
  95.       return ret;
  96. > }
  97.   
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/objects/obj_xref.c:107:9: Taking false branch
105.           return 0;
106.       ntr = OPENSSL_malloc(sizeof(*ntr));
107.       if (ntr == NULL)
               ^
108.           return 0;
109.       ntr->sign_id = signid;

crypto/objects/obj_xref.c:109:5: 
107.       if (ntr == NULL)
108.           return 0;
109. >     ntr->sign_id = signid;
110.       ntr->hash_id = dig_id;
111.       ntr->pkey_id = pkey_id;

crypto/objects/obj_xref.c:110:5: 
108.           return 0;
109.       ntr->sign_id = signid;
110. >     ntr->hash_id = dig_id;
111.       ntr->pkey_id = pkey_id;
112.   

crypto/objects/obj_xref.c:111:5: 
109.       ntr->sign_id = signid;
110.       ntr->hash_id = dig_id;
111. >     ntr->pkey_id = pkey_id;
112.   
113.       if (!sk_nid_triple_push(sig_app, ntr)) {

crypto/objects/obj_xref.c:113:10: 
111.       ntr->pkey_id = pkey_id;
112.   
113. >     if (!sk_nid_triple_push(sig_app, ntr)) {
114.           OPENSSL_free(ntr);
115.           return 0;

crypto/objects/obj_xref.h:20:1: start of procedure sk_nid_triple_push()
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/stack/stack.c:200:1: start of procedure OPENSSL_sk_push()
    198.   }
    199.   
    200. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));

crypto/stack/stack.c:202:5: Skipping OPENSSL_sk_insert(): empty list of specs
    200.   int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));
               ^
    203.   }
    204.   

crypto/stack/stack.c:203:1: return from a call to OPENSSL_sk_push
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));
    203. > }
    204.   
    205.   int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)

crypto/objects/obj_xref.h:20:1: return from a call to sk_nid_triple_push
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.c:113:10: Taking false branch
111.       ntr->pkey_id = pkey_id;
112.   
113.       if (!sk_nid_triple_push(sig_app, ntr)) {
                ^
114.           OPENSSL_free(ntr);
115.           return 0;

crypto/objects/obj_xref.c:118:10: 
116.       }
117.   
118. >     if (!sk_nid_triple_push(sigx_app, ntr))
119.           return 0;
120.   

crypto/objects/obj_xref.h:20:1: start of procedure sk_nid_triple_push()
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

crypto/stack/stack.c:200:1: start of procedure OPENSSL_sk_push()
    198.   }
    199.   
    200. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));

crypto/stack/stack.c:202:5: Skipping OPENSSL_sk_insert(): empty list of specs
    200.   int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));
               ^
    203.   }
    204.   

crypto/stack/stack.c:203:1: return from a call to OPENSSL_sk_push
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));
    203. > }
    204.   
    205.   int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)

crypto/objects/obj_xref.h:20:1: return from a call to sk_nid_triple_push
  18.   } nid_triple;
  19.   
  20. > DEFINE_STACK_OF(nid_triple)
  21.   
  22.   static const nid_triple sigoid_srt[] = {

int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
{
    nid_triple *ntr;
    if (sig_app == NULL)
        sig_app = sk_nid_triple_new(sig_sk_cmp);
    if (sig_app == NULL)
        return 0;
    if (sigx_app == NULL)
        sigx_app = sk_nid_triple_new(sigx_cmp);
    if (sigx_app == NULL)
        return 0;
    ntr = OPENSSL_malloc(sizeof(*ntr));
    if (ntr == NULL)
        return 0;
    ntr->sign_id = signid;
    ntr->hash_id = dig_id;
    ntr->pkey_id = pkey_id;
    if (!sk_nid_triple_push(sig_app, ntr)) {
        OPENSSL_free(ntr);
        return 0;
    }
    if (!sk_nid_triple_push(sigx_app, ntr))
        return 0;
    sk_nid_triple_sort(sig_app);
    sk_nid_triple_sort(sigx_app);
    return 1;
}
['int OBJ_add_sigid(int signid, int dig_id, int pkey_id)\n{\n    nid_triple *ntr;\n    if (sig_app == NULL)\n        sig_app = sk_nid_triple_new(sig_sk_cmp);\n    if (sig_app == NULL)\n        return 0;\n    if (sigx_app == NULL)\n        sigx_app = sk_nid_triple_new(sigx_cmp);\n    if (sigx_app == NULL)\n        return 0;\n    ntr = OPENSSL_malloc(sizeof(*ntr));\n    if (ntr == NULL)\n        return 0;\n    ntr->sign_id = signid;\n    ntr->hash_id = dig_id;\n    ntr->pkey_id = pkey_id;\n    if (!sk_nid_triple_push(sig_app, ntr)) {\n        OPENSSL_free(ntr);\n        return 0;\n    }\n    if (!sk_nid_triple_push(sigx_app, ntr))\n        return 0;\n    sk_nid_triple_sort(sig_app);\n    sk_nid_triple_sort(sigx_app);\n    return 1;\n}', 'DEFINE_STACK_OF(nid_triple)', '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    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}', 'int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)\n{\n    return (OPENSSL_sk_insert(st, data, st->num));\n}']