crypto/asn1/tasn_new.c:241: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_ASN1_VALUE_new_null()` at line 224, column 17 is not reachable after line 241, column 1.
Showing all 37 steps of the trace


crypto/asn1/tasn_new.c:197:1: start of procedure asn1_template_new()
195.   }
196.   
197. > static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
198.   {
199.       const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);

crypto/asn1/tasn_new.c:199:5: 
197.   static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
198.   {
199. >     const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
200.       int embed = tt->flags & ASN1_TFLG_EMBED;
201.       ASN1_VALUE *tval;

crypto/asn1/tasn_new.c:200:5: 
198.   {
199.       const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
200. >     int embed = tt->flags & ASN1_TFLG_EMBED;
201.       ASN1_VALUE *tval;
202.       int ret;

crypto/asn1/tasn_new.c:203:9: Taking true branch
201.       ASN1_VALUE *tval;
202.       int ret;
203.       if (embed) {
               ^
204.           tval = (ASN1_VALUE *)pval;
205.           pval = &tval;

crypto/asn1/tasn_new.c:204:9: 
202.       int ret;
203.       if (embed) {
204. >         tval = (ASN1_VALUE *)pval;
205.           pval = &tval;
206.       }

crypto/asn1/tasn_new.c:205:9: 
203.       if (embed) {
204.           tval = (ASN1_VALUE *)pval;
205. >         pval = &tval;
206.       }
207.       if (tt->flags & ASN1_TFLG_OPTIONAL) {

crypto/asn1/tasn_new.c:207:9: Taking false branch
205.           pval = &tval;
206.       }
207.       if (tt->flags & ASN1_TFLG_OPTIONAL) {
               ^
208.           asn1_template_clear(pval, tt);
209.           return 1;

crypto/asn1/tasn_new.c:213:9: Taking false branch
211.       /* If ANY DEFINED BY nothing to do */
212.   
213.       if (tt->flags & ASN1_TFLG_ADB_MASK) {
               ^
214.           *pval = NULL;
215.           return 1;

crypto/asn1/tasn_new.c:222:9: Taking true branch
220.   #endif
221.       /* If SET OF or SEQUENCE OF, its a STACK */
222.       if (tt->flags & ASN1_TFLG_SK_MASK) {
               ^
223.           STACK_OF(ASN1_VALUE) *skval;
224.           skval = sk_ASN1_VALUE_new_null();

crypto/asn1/tasn_new.c:224:9: 
222.       if (tt->flags & ASN1_TFLG_SK_MASK) {
223.           STACK_OF(ASN1_VALUE) *skval;
224. >         skval = sk_ASN1_VALUE_new_null();
225.           if (!skval) {
226.               ASN1err(ASN1_F_ASN1_TEMPLATE_NEW, ERR_R_MALLOC_FAILURE);

include/openssl/asn1t.h:928:1: start of procedure sk_ASN1_VALUE_new_null()
  926.   # endif
  927.   
  928. > DEFINE_STACK_OF(ASN1_VALUE)
  929.   
  930.   /* Functions used internally by the ASN1 code */

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/asn1t.h:928:1: return from a call to sk_ASN1_VALUE_new_null
  926.   # endif
  927.   
  928. > DEFINE_STACK_OF(ASN1_VALUE)
  929.   
  930.   /* Functions used internally by the ASN1 code */

crypto/asn1/tasn_new.c:225:14: Taking false branch
223.           STACK_OF(ASN1_VALUE) *skval;
224.           skval = sk_ASN1_VALUE_new_null();
225.           if (!skval) {
                    ^
226.               ASN1err(ASN1_F_ASN1_TEMPLATE_NEW, ERR_R_MALLOC_FAILURE);
227.               ret = 0;

crypto/asn1/tasn_new.c:230:9: 
228.               goto done;
229.           }
230. >         *pval = (ASN1_VALUE *)skval;
231.           ret = 1;
232.           goto done;

crypto/asn1/tasn_new.c:231:9: 
229.           }
230.           *pval = (ASN1_VALUE *)skval;
231. >         ret = 1;
232.           goto done;
233.       }

crypto/asn1/tasn_new.c:236:2: 
234.       /* Otherwise pass it back to the item routine */
235.       ret = asn1_item_embed_new(pval, it, embed);
236. >  done:
237.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
238.       OPENSSL_mem_debug_pop();

crypto/asn1/tasn_new.c:240:5: 
238.       OPENSSL_mem_debug_pop();
239.   #endif
240. >     return ret;
241.   }
242.   

crypto/asn1/tasn_new.c:241:1: return from a call to asn1_template_new
239.   #endif
240.       return ret;
241. > }
242.   
243.   static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
