crypto/ocsp/ocsp_ext.c:477: error: MEMORY_LEAK
  memory dynamically allocated by call to `ASN1_GENERALIZEDTIME_new()` at line 471, column 15 is not reachable after line 477, column 5.
Showing all 51 steps of the trace


crypto/ocsp/ocsp_ext.c:466:1: start of procedure OCSP_archive_cutoff_new()
464.   
465.   /*  ArchiveCutoff ::= GeneralizedTime */
466. > X509_EXTENSION *OCSP_archive_cutoff_new(char *tim)
467.   {
468.       X509_EXTENSION *x = NULL;

crypto/ocsp/ocsp_ext.c:468:5: 
466.   X509_EXTENSION *OCSP_archive_cutoff_new(char *tim)
467.   {
468. >     X509_EXTENSION *x = NULL;
469.       ASN1_GENERALIZEDTIME *gt = NULL;
470.   

crypto/ocsp/ocsp_ext.c:469:5: 
467.   {
468.       X509_EXTENSION *x = NULL;
469. >     ASN1_GENERALIZEDTIME *gt = NULL;
470.   
471.       if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)

crypto/ocsp/ocsp_ext.c:471:9: 
469.       ASN1_GENERALIZEDTIME *gt = NULL;
470.   
471. >     if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
472.           goto err;
473.       if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))

crypto/asn1/tasn_typ.c:87:1: start of procedure ASN1_GENERALIZEDTIME_new()
  85.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING)
  86.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME)
  87. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME)
  88.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING)
  89.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING)

crypto/asn1/asn1_lib.c:349:1: start of procedure ASN1_STRING_type_new()
    347.   }
    348.   
    349. > ASN1_STRING *ASN1_STRING_type_new(int type)
    350.   {
    351.       ASN1_STRING *ret;

crypto/asn1/asn1_lib.c:353:5: 
    351.       ASN1_STRING *ret;
    352.   
    353. >     ret = OPENSSL_zalloc(sizeof(*ret));
    354.       if (ret == NULL) {
    355.           ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
      155.   }
      156.   
      157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      158.   {
      159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
      157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      158.   {
      159. >     void *ret = CRYPTO_malloc(num, file, line);
      160.   
      161.       if (ret != NULL)

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
        118.   }
        119.   
        120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        121.   {
        122.       void *ret = NULL;

crypto/mem.c:122:5: 
        120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        121.   {
        122. >     void *ret = NULL;
        123.   
        124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
        122.       void *ret = NULL;
        123.   
        124.       if (num <= 0)
                       ^
        125.           return NULL;
        126.   

crypto/mem.c:127:5: 
        125.           return NULL;
        126.   
        127. >     allow_customize = 0;
        128.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
        135.       }
        136.   #else
        137. >     (void)file;
        138.       (void)line;
        139.       ret = malloc(num);

crypto/mem.c:138:5: 
        136.   #else
        137.       (void)file;
        138. >     (void)line;
        139.       ret = malloc(num);
        140.   #endif

crypto/mem.c:139:5: 
        137.       (void)file;
        138.       (void)line;
        139. >     ret = malloc(num);
        140.   #endif
        141.   

crypto/mem.c:154:5: 
        152.   #endif
        153.   
        154. >     return ret;
        155.   }
        156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
        153.   
        154.       return ret;
        155. > }
        156.   
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
      159.       void *ret = CRYPTO_malloc(num, file, line);
      160.   
      161.       if (ret != NULL)
                     ^
      162.           memset(ret, 0, num);
      163.       return ret;

crypto/mem.c:162:9: 
      160.   
      161.       if (ret != NULL)
      162. >         memset(ret, 0, num);
      163.       return ret;
      164.   }

crypto/mem.c:163:5: 
      161.       if (ret != NULL)
      162.           memset(ret, 0, num);
      163. >     return ret;
      164.   }
      165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
      162.           memset(ret, 0, num);
      163.       return ret;
      164. > }
      165.   
      166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/asn1/asn1_lib.c:354:9: Taking false branch
    352.   
    353.       ret = OPENSSL_zalloc(sizeof(*ret));
    354.       if (ret == NULL) {
                   ^
    355.           ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
    356.           return (NULL);

crypto/asn1/asn1_lib.c:358:5: 
    356.           return (NULL);
    357.       }
    358. >     ret->type = type;
    359.       return (ret);
    360.   }

crypto/asn1/asn1_lib.c:359:5: 
    357.       }
    358.       ret->type = type;
    359. >     return (ret);
    360.   }
    361.   

crypto/asn1/asn1_lib.c:360:1: return from a call to ASN1_STRING_type_new
    358.       ret->type = type;
    359.       return (ret);
    360. > }
    361.   
    362.   void ASN1_STRING_free(ASN1_STRING *a)

crypto/asn1/tasn_typ.c:87:1: return from a call to ASN1_GENERALIZEDTIME_new
  85.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING)
  86.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME)
  87. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME)
  88.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING)
  89.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING)

crypto/ocsp/ocsp_ext.c:471:9: Taking false branch
469.       ASN1_GENERALIZEDTIME *gt = NULL;
470.   
471.       if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
               ^
472.           goto err;
473.       if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))

crypto/ocsp/ocsp_ext.c:473:11: 
471.       if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
472.           goto err;
473. >     if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))
474.           goto err;
475.       x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);

crypto/asn1/a_gentm.c:191:1: start of procedure ASN1_GENERALIZEDTIME_set_string()
  189.   }
  190.   
  191. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
  192.   {
  193.       ASN1_GENERALIZEDTIME t;

crypto/asn1/a_gentm.c:195:5: 
  193.       ASN1_GENERALIZEDTIME t;
  194.   
  195. >     t.type = V_ASN1_GENERALIZEDTIME;
  196.       t.length = strlen(str);
  197.       t.data = (unsigned char *)str;

crypto/asn1/a_gentm.c:196:5: 
  194.   
  195.       t.type = V_ASN1_GENERALIZEDTIME;
  196. >     t.length = strlen(str);
  197.       t.data = (unsigned char *)str;
  198.       if (ASN1_GENERALIZEDTIME_check(&t)) {

crypto/asn1/a_gentm.c:197:5: 
  195.       t.type = V_ASN1_GENERALIZEDTIME;
  196.       t.length = strlen(str);
  197. >     t.data = (unsigned char *)str;
  198.       if (ASN1_GENERALIZEDTIME_check(&t)) {
  199.           if (s != NULL) {

crypto/asn1/a_gentm.c:198:9: 
  196.       t.length = strlen(str);
  197.       t.data = (unsigned char *)str;
  198. >     if (ASN1_GENERALIZEDTIME_check(&t)) {
  199.           if (s != NULL) {
  200.               if (!ASN1_STRING_set((ASN1_STRING *)s,

crypto/asn1/a_gentm.c:186:1: start of procedure ASN1_GENERALIZEDTIME_check()
    184.   }
    185.   
    186. > int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
    187.   {
    188.       return asn1_generalizedtime_to_tm(NULL, d);

crypto/asn1/a_gentm.c:188:5: Skipping asn1_generalizedtime_to_tm(): empty list of specs
    186.   int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
    187.   {
    188.       return asn1_generalizedtime_to_tm(NULL, d);
               ^
    189.   }
    190.   

crypto/asn1/a_gentm.c:189:1: return from a call to ASN1_GENERALIZEDTIME_check
    187.   {
    188.       return asn1_generalizedtime_to_tm(NULL, d);
    189. > }
    190.   
    191.   int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)

crypto/asn1/a_gentm.c:198:9: Taking false branch
  196.       t.length = strlen(str);
  197.       t.data = (unsigned char *)str;
  198.       if (ASN1_GENERALIZEDTIME_check(&t)) {
                 ^
  199.           if (s != NULL) {
  200.               if (!ASN1_STRING_set((ASN1_STRING *)s,

crypto/asn1/a_gentm.c:207:9: 
  205.           return (1);
  206.       } else
  207. >         return (0);
  208.   }
  209.   

crypto/asn1/a_gentm.c:208:1: return from a call to ASN1_GENERALIZEDTIME_set_string
  206.       } else
  207.           return (0);
  208. > }
  209.   
  210.   ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,

crypto/ocsp/ocsp_ext.c:473:11: Taking true branch
471.       if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
472.           goto err;
473.       if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))
                 ^
474.           goto err;
475.       x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);

crypto/ocsp/ocsp_ext.c:476:2: 
474.           goto err;
475.       x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);
476. >  err:
477.       ASN1_GENERALIZEDTIME_free(gt);
478.       return x;

crypto/ocsp/ocsp_ext.c:477:5: 
475.       x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);
476.    err:
477. >     ASN1_GENERALIZEDTIME_free(gt);
478.       return x;
479.   }

crypto/asn1/tasn_typ.c:87:1: start of procedure ASN1_GENERALIZEDTIME_free()
  85.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING)
  86.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME)
  87. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME)
  88.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING)
  89.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING)

crypto/asn1/asn1_lib.c:362:1: start of procedure ASN1_STRING_free()
    360.   }
    361.   
    362. > void ASN1_STRING_free(ASN1_STRING *a)
    363.   {
    364.       if (a == NULL)

crypto/asn1/asn1_lib.c:364:9: Taking false branch
    362.   void ASN1_STRING_free(ASN1_STRING *a)
    363.   {
    364.       if (a == NULL)
                   ^
    365.           return;
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))

crypto/asn1/asn1_lib.c:366:11: Taking false branch
    364.       if (a == NULL)
    365.           return;
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
                     ^
    367.           OPENSSL_free(a->data);
    368.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))

crypto/asn1/asn1_lib.c:368:11: Taking false branch
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    367.           OPENSSL_free(a->data);
    368.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
                     ^
    369.           OPENSSL_free(a);
    370.   }

crypto/asn1/asn1_lib.c:368:5: 
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    367.           OPENSSL_free(a->data);
    368. >     if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    369.           OPENSSL_free(a);
    370.   }

crypto/asn1/asn1_lib.c:370:1: return from a call to ASN1_STRING_free
    368.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    369.           OPENSSL_free(a);
    370. > }
    371.   
    372.   void ASN1_STRING_clear_free(ASN1_STRING *a)

crypto/asn1/tasn_typ.c:87:1: return from a call to ASN1_GENERALIZEDTIME_free
  85.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING)
  86.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME)
  87. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME)
  88.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING)
  89.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING)
