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


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

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

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

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

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

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

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

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

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

crypto/asn1/tasn_new.c:226:9: 
224.       if (tt->flags & ASN1_TFLG_SK_MASK) {
225.           STACK_OF(ASN1_VALUE) *skval;
226. >         skval = sk_ASN1_VALUE_new_null();
227.           if (!skval) {
228.               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: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/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:227:14: Taking false branch
225.           STACK_OF(ASN1_VALUE) *skval;
226.           skval = sk_ASN1_VALUE_new_null();
227.           if (!skval) {
                    ^
228.               ASN1err(ASN1_F_ASN1_TEMPLATE_NEW, ERR_R_MALLOC_FAILURE);
229.               ret = 0;

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

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

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

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

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