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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X509_EXTENSION *OCSP_archive_cutoff_new(char *tim)
{
    X509_EXTENSION *x = NULL;
    ASN1_GENERALIZEDTIME *gt = NULL;
    if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
        goto err;
    if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))
        goto err;
    x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);
 err:
    ASN1_GENERALIZEDTIME_free(gt);
    return x;
}
['X509_EXTENSION *OCSP_archive_cutoff_new(char *tim)\n{\n    X509_EXTENSION *x = NULL;\n    ASN1_GENERALIZEDTIME *gt = NULL;\n    if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)\n        goto err;\n    if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))\n        goto err;\n    x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);\n err:\n    ASN1_GENERALIZEDTIME_free(gt);\n    return x;\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME)', 'ASN1_STRING *ASN1_STRING_type_new(int type)\n{\n    ASN1_STRING *ret;\n    ret = OPENSSL_zalloc(sizeof(*ret));\n    if (ret == NULL) {\n        ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->type = type;\n    return (ret);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\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 (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    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)\n{\n    ASN1_GENERALIZEDTIME t;\n    t.type = V_ASN1_GENERALIZEDTIME;\n    t.length = strlen(str);\n    t.data = (unsigned char *)str;\n    if (ASN1_GENERALIZEDTIME_check(&t)) {\n        if (s != NULL) {\n            if (!ASN1_STRING_set((ASN1_STRING *)s,\n                                 (unsigned char *)str, t.length))\n                return 0;\n            s->type = V_ASN1_GENERALIZEDTIME;\n        }\n        return (1);\n    } else\n        return (0);\n}', 'int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)\n{\n    return asn1_generalizedtime_to_tm(NULL, d);\n}', 'void ASN1_STRING_free(ASN1_STRING *a)\n{\n    if (a == NULL)\n        return;\n    if (!(a->flags & ASN1_STRING_FLAG_NDEF))\n        OPENSSL_free(a->data);\n    if (!(a->flags & ASN1_STRING_FLAG_EMBED))\n        OPENSSL_free(a);\n}']