apps/ca.c:2487: error: MEMORY_LEAK
  memory dynamically allocated by call to `ASN1_ENUMERATED_new()` at line 2459, column 16 is not reachable after line 2487, column 5.
Showing all 111 steps of the trace


apps/ca.c:2439:1: start of procedure make_revoked()
2437.    */
2438.   
2439. > int make_revoked(X509_REVOKED *rev, const char *str)
2440.   {
2441.       char *tmp = NULL;

apps/ca.c:2441:5: 
2439.   int make_revoked(X509_REVOKED *rev, const char *str)
2440.   {
2441. >     char *tmp = NULL;
2442.       int reason_code = -1;
2443.       int i, ret = 0;

apps/ca.c:2442:5: 
2440.   {
2441.       char *tmp = NULL;
2442. >     int reason_code = -1;
2443.       int i, ret = 0;
2444.       ASN1_OBJECT *hold = NULL;

apps/ca.c:2443:5: 
2441.       char *tmp = NULL;
2442.       int reason_code = -1;
2443. >     int i, ret = 0;
2444.       ASN1_OBJECT *hold = NULL;
2445.       ASN1_GENERALIZEDTIME *comp_time = NULL;

apps/ca.c:2444:5: 
2442.       int reason_code = -1;
2443.       int i, ret = 0;
2444. >     ASN1_OBJECT *hold = NULL;
2445.       ASN1_GENERALIZEDTIME *comp_time = NULL;
2446.       ASN1_ENUMERATED *rtmp = NULL;

apps/ca.c:2445:5: 
2443.       int i, ret = 0;
2444.       ASN1_OBJECT *hold = NULL;
2445. >     ASN1_GENERALIZEDTIME *comp_time = NULL;
2446.       ASN1_ENUMERATED *rtmp = NULL;
2447.   

apps/ca.c:2446:5: 
2444.       ASN1_OBJECT *hold = NULL;
2445.       ASN1_GENERALIZEDTIME *comp_time = NULL;
2446. >     ASN1_ENUMERATED *rtmp = NULL;
2447.   
2448.       ASN1_TIME *revDate = NULL;

apps/ca.c:2448:5: 
2446.       ASN1_ENUMERATED *rtmp = NULL;
2447.   
2448. >     ASN1_TIME *revDate = NULL;
2449.   
2450.       i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str);

apps/ca.c:2450:5: Skipping unpack_revinfo(): empty list of specs
2448.       ASN1_TIME *revDate = NULL;
2449.   
2450.       i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str);
            ^
2451.   
2452.       if (i == 0)

apps/ca.c:2452:9: Taking false branch
2450.       i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str);
2451.   
2452.       if (i == 0)
                ^
2453.           goto end;
2454.   

apps/ca.c:2455:9: Taking true branch
2453.           goto end;
2454.   
2455.       if (rev && !X509_REVOKED_set_revocationDate(rev, revDate))
                ^
2456.           goto end;
2457.   

apps/ca.c:2455:17: 
2453.           goto end;
2454.   
2455. >     if (rev && !X509_REVOKED_set_revocationDate(rev, revDate))
2456.           goto end;
2457.   

crypto/x509/x509cset.c:189:1: start of procedure X509_REVOKED_set_revocationDate()
  187.   }
  188.   
  189. > int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm)
  190.   {
  191.       ASN1_TIME *in;

crypto/x509/x509cset.c:193:9: Taking false branch
  191.       ASN1_TIME *in;
  192.   
  193.       if (x == NULL)
                 ^
  194.           return (0);
  195.       in = x->revocationDate;

crypto/x509/x509cset.c:195:5: 
  193.       if (x == NULL)
  194.           return (0);
  195. >     in = x->revocationDate;
  196.       if (in != tm) {
  197.           in = ASN1_STRING_dup(tm);

crypto/x509/x509cset.c:196:9: Taking false branch
  194.           return (0);
  195.       in = x->revocationDate;
  196.       if (in != tm) {
                 ^
  197.           in = ASN1_STRING_dup(tm);
  198.           if (in != NULL) {

crypto/x509/x509cset.c:203:13: Condition is true
  201.           }
  202.       }
  203.       return (in != NULL);
                     ^
  204.   }
  205.   

crypto/x509/x509cset.c:203:5: 
  201.           }
  202.       }
  203. >     return (in != NULL);
  204.   }
  205.   

crypto/x509/x509cset.c:204:1: return from a call to X509_REVOKED_set_revocationDate
  202.       }
  203.       return (in != NULL);
  204. > }
  205.   
  206.   ASN1_INTEGER *X509_REVOKED_get0_serialNumber(X509_REVOKED *x)

apps/ca.c:2455:17: Taking false branch
2453.           goto end;
2454.   
2455.       if (rev && !X509_REVOKED_set_revocationDate(rev, revDate))
                        ^
2456.           goto end;
2457.   

apps/ca.c:2458:9: Taking true branch
2456.           goto end;
2457.   
2458.       if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
                ^
2459.           rtmp = ASN1_ENUMERATED_new();
2460.           if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))

apps/ca.c:2458:17: Taking true branch
2456.           goto end;
2457.   
2458.       if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
                        ^
2459.           rtmp = ASN1_ENUMERATED_new();
2460.           if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))

apps/ca.c:2459:9: 
2457.   
2458.       if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
2459. >         rtmp = ASN1_ENUMERATED_new();
2460.           if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))
2461.               goto end;

crypto/asn1/tasn_typ.c:78:1: start of procedure ASN1_ENUMERATED_new()
  76.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  77.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
  80.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING)

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:78:1: return from a call to ASN1_ENUMERATED_new
  76.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  77.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
  80.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING)

apps/ca.c:2460:13: Taking false branch
2458.       if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
2459.           rtmp = ASN1_ENUMERATED_new();
2460.           if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))
                    ^
2461.               goto end;
2462.           if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0))

apps/ca.c:2460:30: 
2458.       if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
2459.           rtmp = ASN1_ENUMERATED_new();
2460. >         if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))
2461.               goto end;
2462.           if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0))

crypto/asn1/a_int.c:641:1: start of procedure ASN1_ENUMERATED_set()
  639.   }
  640.   
  641. > int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
  642.   {
  643.       return ASN1_ENUMERATED_set_int64(a, v);

crypto/asn1/a_int.c:643:5: 
  641.   int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
  642.   {
  643. >     return ASN1_ENUMERATED_set_int64(a, v);
  644.   }
  645.   

crypto/asn1/a_int.c:636:1: start of procedure ASN1_ENUMERATED_set_int64()
    634.   }
    635.   
    636. > int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r)
    637.   {
    638.       return asn1_string_set_int64(a, r, V_ASN1_ENUMERATED);

crypto/asn1/a_int.c:638:5: 
    636.   int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r)
    637.   {
    638. >     return asn1_string_set_int64(a, r, V_ASN1_ENUMERATED);
    639.   }
    640.   

crypto/asn1/a_int.c:404:1: start of procedure asn1_string_set_int64()
      402.   }
      403.   
      404. > static int asn1_string_set_int64(ASN1_STRING *a, int64_t r, int itype)
      405.   {
      406.       unsigned char tbuf[sizeof(r)];

crypto/asn1/a_int.c:408:5: 
      406.       unsigned char tbuf[sizeof(r)];
      407.       size_t l;
      408. >     a->type = itype;
      409.       if (r < 0) {
      410.           l = asn1_put_uint64(tbuf, -r);

crypto/asn1/a_int.c:409:9: Taking true branch
      407.       size_t l;
      408.       a->type = itype;
      409.       if (r < 0) {
                     ^
      410.           l = asn1_put_uint64(tbuf, -r);
      411.           a->type |= V_ASN1_NEG;

crypto/asn1/a_int.c:410:9: 
      408.       a->type = itype;
      409.       if (r < 0) {
      410. >         l = asn1_put_uint64(tbuf, -r);
      411.           a->type |= V_ASN1_NEG;
      412.       } else {

crypto/asn1/a_int.c:291:1: start of procedure asn1_put_uint64()
        289.   }
        290.   
        291. > static size_t asn1_put_uint64(unsigned char *b, uint64_t r)
        292.   {
        293.       if (r >= 0x100) {

crypto/asn1/a_int.c:293:9: Taking false branch
        291.   static size_t asn1_put_uint64(unsigned char *b, uint64_t r)
        292.   {
        293.       if (r >= 0x100) {
                       ^
        294.           unsigned char *p;
        295.           uint64_t rtmp = r;

crypto/asn1/a_int.c:315:5: 
        313.       }
        314.   
        315. >     b[0] = (unsigned char)r;
        316.       return 1;
        317.   

crypto/asn1/a_int.c:316:5: 
        314.   
        315.       b[0] = (unsigned char)r;
        316. >     return 1;
        317.   
        318.   }

crypto/asn1/a_int.c:318:1: return from a call to asn1_put_uint64
        316.       return 1;
        317.   
        318. > }
        319.   
        320.   /*

crypto/asn1/a_int.c:411:9: 
      409.       if (r < 0) {
      410.           l = asn1_put_uint64(tbuf, -r);
      411. >         a->type |= V_ASN1_NEG;
      412.       } else {
      413.           l = asn1_put_uint64(tbuf, r);

crypto/asn1/a_int.c:416:9: Taking false branch
      414.           a->type &= ~V_ASN1_NEG;
      415.       }
      416.       if (l == 0)
                     ^
      417.           return 0;
      418.       return ASN1_STRING_set(a, tbuf, l);

crypto/asn1/a_int.c:418:5: 
      416.       if (l == 0)
      417.           return 0;
      418. >     return ASN1_STRING_set(a, tbuf, l);
      419.   }
      420.   

crypto/asn1/asn1_lib.c:307:1: start of procedure ASN1_STRING_set()
        305.   }
        306.   
        307. > int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
        308.   {
        309.       unsigned char *c;

crypto/asn1/asn1_lib.c:310:5: 
        308.   {
        309.       unsigned char *c;
        310. >     const char *data = _data;
        311.   
        312.       if (len < 0) {

crypto/asn1/asn1_lib.c:312:9: Taking false branch
        310.       const char *data = _data;
        311.   
        312.       if (len < 0) {
                       ^
        313.           if (data == NULL)
        314.               return (0);

crypto/asn1/asn1_lib.c:318:10: Taking true branch
        316.               len = strlen(data);
        317.       }
        318.       if ((str->length < len) || (str->data == NULL)) {
                        ^
        319.           c = str->data;
        320.           str->data = OPENSSL_realloc(c, len + 1);

crypto/asn1/asn1_lib.c:319:9: 
        317.       }
        318.       if ((str->length < len) || (str->data == NULL)) {
        319. >         c = str->data;
        320.           str->data = OPENSSL_realloc(c, len + 1);
        321.           if (str->data == NULL) {

crypto/asn1/asn1_lib.c:320:9: 
        318.       if ((str->length < len) || (str->data == NULL)) {
        319.           c = str->data;
        320. >         str->data = OPENSSL_realloc(c, len + 1);
        321.           if (str->data == NULL) {
        322.               ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);

crypto/mem.c:165:1: start of procedure CRYPTO_realloc()
          163.   }
          164.   
          165. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
          166.   {
          167.       if (str == NULL)

crypto/mem.c:167:9: Taking false branch
          165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
          166.   {
          167.       if (str == NULL)
                         ^
          168.           return CRYPTO_malloc(num, file, line);
          169.   

crypto/mem.c:170:9: Taking false branch
          168.           return CRYPTO_malloc(num, file, line);
          169.   
          170.       if (num == 0) {
                         ^
          171.           CRYPTO_free(str);
          172.           return NULL;

crypto/mem.c:175:5: 
          173.       }
          174.   
          175. >     allow_customize = 0;
          176.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
          177.       if (call_malloc_debug) {

crypto/mem.c:185:5: 
          183.       }
          184.   #else
          185. >     (void)file;
          186.       (void)line;
          187.   #endif

crypto/mem.c:186:5: 
          184.   #else
          185.       (void)file;
          186. >     (void)line;
          187.   #endif
          188.       return realloc(str, num);

crypto/mem.c:188:5: 
          186.       (void)line;
          187.   #endif
          188. >     return realloc(str, num);
          189.   
          190.   }

crypto/mem.c:190:1: return from a call to CRYPTO_realloc
          188.       return realloc(str, num);
          189.   
          190. > }
          191.   
          192.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

crypto/asn1/asn1_lib.c:321:13: Taking true branch
        319.           c = str->data;
        320.           str->data = OPENSSL_realloc(c, len + 1);
        321.           if (str->data == NULL) {
                           ^
        322.               ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);
        323.               str->data = c;

crypto/asn1/asn1_lib.c:322:13: Skipping ERR_put_error(): empty list of specs
        320.           str->data = OPENSSL_realloc(c, len + 1);
        321.           if (str->data == NULL) {
        322.               ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);
                           ^
        323.               str->data = c;
        324.               return (0);

crypto/asn1/asn1_lib.c:323:13: 
        321.           if (str->data == NULL) {
        322.               ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);
        323. >             str->data = c;
        324.               return (0);
        325.           }

crypto/asn1/asn1_lib.c:324:13: 
        322.               ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);
        323.               str->data = c;
        324. >             return (0);
        325.           }
        326.       }

crypto/asn1/asn1_lib.c:334:1: return from a call to ASN1_STRING_set
        332.       }
        333.       return (1);
        334. > }
        335.   
        336.   void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len)

crypto/asn1/a_int.c:419:1: return from a call to asn1_string_set_int64
      417.           return 0;
      418.       return ASN1_STRING_set(a, tbuf, l);
      419. > }
      420.   
      421.   static int asn1_string_get_uint64(uint64_t *pr, const ASN1_STRING *a,

crypto/asn1/a_int.c:639:1: return from a call to ASN1_ENUMERATED_set_int64
    637.   {
    638.       return asn1_string_set_int64(a, r, V_ASN1_ENUMERATED);
    639. > }
    640.   
    641.   int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)

crypto/asn1/a_int.c:644:1: return from a call to ASN1_ENUMERATED_set
  642.   {
  643.       return ASN1_ENUMERATED_set_int64(a, v);
  644. > }
  645.   
  646.   long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)

apps/ca.c:2460:30: Taking true branch
2458.       if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
2459.           rtmp = ASN1_ENUMERATED_new();
2460.           if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))
                                     ^
2461.               goto end;
2462.           if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0))

apps/ca.c:2482:2: 
2480.           ret = 1;
2481.   
2482. >  end:
2483.   
2484.       OPENSSL_free(tmp);

apps/ca.c:2484:5: 
2482.    end:
2483.   
2484. >     OPENSSL_free(tmp);
2485.       ASN1_OBJECT_free(hold);
2486.       ASN1_GENERALIZEDTIME_free(comp_time);

crypto/mem.c:233:1: start of procedure CRYPTO_free()
  231.   }
  232.   
  233. > void CRYPTO_free(void *str)
  234.   {
  235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
  242.       }
  243.   #else
  244. >     free(str);
  245.   #endif
  246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
  244.       free(str);
  245.   #endif
  246. > }
  247.   
  248.   void CRYPTO_clear_free(void *str, size_t num)

apps/ca.c:2485:5: Skipping ASN1_OBJECT_free(): empty list of specs
2483.   
2484.       OPENSSL_free(tmp);
2485.       ASN1_OBJECT_free(hold);
            ^
2486.       ASN1_GENERALIZEDTIME_free(comp_time);
2487.       ASN1_ENUMERATED_free(rtmp);

apps/ca.c:2486:5: 
2484.       OPENSSL_free(tmp);
2485.       ASN1_OBJECT_free(hold);
2486. >     ASN1_GENERALIZEDTIME_free(comp_time);
2487.       ASN1_ENUMERATED_free(rtmp);
2488.       ASN1_TIME_free(revDate);

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)

apps/ca.c:2487:5: 
2485.       ASN1_OBJECT_free(hold);
2486.       ASN1_GENERALIZEDTIME_free(comp_time);
2487. >     ASN1_ENUMERATED_free(rtmp);
2488.       ASN1_TIME_free(revDate);
2489.   

crypto/asn1/tasn_typ.c:78:1: start of procedure ASN1_ENUMERATED_free()
  76.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  77.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
  80.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING)

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:78:1: return from a call to ASN1_ENUMERATED_free
  76.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  77.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
  80.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING)

int make_revoked(X509_REVOKED *rev, const char *str)
{
    char *tmp = NULL;
    int reason_code = -1;
    int i, ret = 0;
    ASN1_OBJECT *hold = NULL;
    ASN1_GENERALIZEDTIME *comp_time = NULL;
    ASN1_ENUMERATED *rtmp = NULL;
    ASN1_TIME *revDate = NULL;
    i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str);
    if (i == 0)
        goto end;
    if (rev && !X509_REVOKED_set_revocationDate(rev, revDate))
        goto end;
    if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
        rtmp = ASN1_ENUMERATED_new();
        if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))
            goto end;
        if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0))
            goto end;
    }
    if (rev && comp_time) {
        if (!X509_REVOKED_add1_ext_i2d
            (rev, NID_invalidity_date, comp_time, 0, 0))
            goto end;
    }
    if (rev && hold) {
        if (!X509_REVOKED_add1_ext_i2d
            (rev, NID_hold_instruction_code, hold, 0, 0))
            goto end;
    }
    if (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)
        ret = 2;
    else
        ret = 1;
 end:
    OPENSSL_free(tmp);
    ASN1_OBJECT_free(hold);
    ASN1_GENERALIZEDTIME_free(comp_time);
    ASN1_ENUMERATED_free(rtmp);
    ASN1_TIME_free(revDate);
    return ret;
}
['int make_revoked(X509_REVOKED *rev, const char *str)\n{\n    char *tmp = NULL;\n    int reason_code = -1;\n    int i, ret = 0;\n    ASN1_OBJECT *hold = NULL;\n    ASN1_GENERALIZEDTIME *comp_time = NULL;\n    ASN1_ENUMERATED *rtmp = NULL;\n    ASN1_TIME *revDate = NULL;\n    i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str);\n    if (i == 0)\n        goto end;\n    if (rev && !X509_REVOKED_set_revocationDate(rev, revDate))\n        goto end;\n    if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {\n        rtmp = ASN1_ENUMERATED_new();\n        if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))\n            goto end;\n        if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0))\n            goto end;\n    }\n    if (rev && comp_time) {\n        if (!X509_REVOKED_add1_ext_i2d\n            (rev, NID_invalidity_date, comp_time, 0, 0))\n            goto end;\n    }\n    if (rev && hold) {\n        if (!X509_REVOKED_add1_ext_i2d\n            (rev, NID_hold_instruction_code, hold, 0, 0))\n            goto end;\n    }\n    if (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)\n        ret = 2;\n    else\n        ret = 1;\n end:\n    OPENSSL_free(tmp);\n    ASN1_OBJECT_free(hold);\n    ASN1_GENERALIZEDTIME_free(comp_time);\n    ASN1_ENUMERATED_free(rtmp);\n    ASN1_TIME_free(revDate);\n    return ret;\n}', 'int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm)\n{\n    ASN1_TIME *in;\n    if (x == NULL)\n        return (0);\n    in = x->revocationDate;\n    if (in != tm) {\n        in = ASN1_STRING_dup(tm);\n        if (in != NULL) {\n            ASN1_TIME_free(x->revocationDate);\n            x->revocationDate = in;\n        }\n    }\n    return (in != NULL);\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)', '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_ENUMERATED_set(ASN1_ENUMERATED *a, long v)\n{\n    return ASN1_ENUMERATED_set_int64(a, v);\n}', 'int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r)\n{\n    return asn1_string_set_int64(a, r, V_ASN1_ENUMERATED);\n}', 'static int asn1_string_set_int64(ASN1_STRING *a, int64_t r, int itype)\n{\n    unsigned char tbuf[sizeof(r)];\n    size_t l;\n    a->type = itype;\n    if (r < 0) {\n        l = asn1_put_uint64(tbuf, -r);\n        a->type |= V_ASN1_NEG;\n    } else {\n        l = asn1_put_uint64(tbuf, r);\n        a->type &= ~V_ASN1_NEG;\n    }\n    if (l == 0)\n        return 0;\n    return ASN1_STRING_set(a, tbuf, l);\n}', 'static size_t asn1_put_uint64(unsigned char *b, uint64_t r)\n{\n    if (r >= 0x100) {\n        unsigned char *p;\n        uint64_t rtmp = r;\n        size_t i = 0;\n        while (rtmp) {\n            rtmp >>= 8;\n            i++;\n        }\n        p = b + i - 1;\n        do {\n            *p-- = r & 0xFF;\n            r >>= 8;\n        } while (p >= b);\n        return i;\n    }\n    b[0] = (unsigned char)r;\n    return 1;\n}', "int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)\n{\n    unsigned char *c;\n    const char *data = _data;\n    if (len < 0) {\n        if (data == NULL)\n            return (0);\n        else\n            len = strlen(data);\n    }\n    if ((str->length < len) || (str->data == NULL)) {\n        c = str->data;\n        str->data = OPENSSL_realloc(c, len + 1);\n        if (str->data == NULL) {\n            ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);\n            str->data = c;\n            return (0);\n        }\n    }\n    str->length = len;\n    if (data != NULL) {\n        memcpy(str->data, data, len);\n        str->data[len] = '\\0';\n    }\n    return (1);\n}", 'void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)\n{\n    if (str == NULL)\n        return CRYPTO_malloc(num, file, line);\n    if (num == 0) {\n        CRYPTO_free(str);\n        return NULL;\n    }\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        void *ret;\n        CRYPTO_mem_debug_realloc(str, NULL, num, 0, file, line);\n        ret = realloc(str, num);\n        CRYPTO_mem_debug_realloc(str, ret, num, 1, file, line);\n        return ret;\n    }\n#else\n    (void)file;\n    (void)line;\n#endif\n    return realloc(str, num);\n}', 'void CRYPTO_free(void *str)\n{\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME)', '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}']