apps/apps.c:1424: error: MEMORY_LEAK
  memory dynamically allocated by call to `ASN1_INTEGER_new()` at line 1390, column 10 is not reachable after line 1424, column 5.
Showing all 71 steps of the trace


apps/apps.c:1383:1: start of procedure load_serial()
1381.   #undef BSIZE
1382.   #define BSIZE 256
1383. > BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1384.   {
1385.       BIO *in = NULL;

apps/apps.c:1385:5: 
1383.   BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1384.   {
1385. >     BIO *in = NULL;
1386.       BIGNUM *ret = NULL;
1387.       char buf[1024];

apps/apps.c:1386:5: 
1384.   {
1385.       BIO *in = NULL;
1386. >     BIGNUM *ret = NULL;
1387.       char buf[1024];
1388.       ASN1_INTEGER *ai = NULL;

apps/apps.c:1388:5: 
1386.       BIGNUM *ret = NULL;
1387.       char buf[1024];
1388. >     ASN1_INTEGER *ai = NULL;
1389.   
1390.       ai = ASN1_INTEGER_new();

apps/apps.c:1390:5: 
1388.       ASN1_INTEGER *ai = NULL;
1389.   
1390. >     ai = ASN1_INTEGER_new();
1391.       if (ai == NULL)
1392.           goto err;

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

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

apps/apps.c:1391:9: Taking false branch
1389.   
1390.       ai = ASN1_INTEGER_new();
1391.       if (ai == NULL)
                ^
1392.           goto err;
1393.   

apps/apps.c:1394:5: Skipping BIO_new_file(): empty list of specs
1392.           goto err;
1393.   
1394.       in = BIO_new_file(serialfile, "r");
            ^
1395.       if (in == NULL) {
1396.           if (!create) {

apps/apps.c:1395:9: Taking false branch
1393.   
1394.       in = BIO_new_file(serialfile, "r");
1395.       if (in == NULL) {
                ^
1396.           if (!create) {
1397.               perror(serialfile);

apps/apps.c:1405:14: Taking true branch
1403.               BIO_printf(bio_err, "Out of memory\n");
1404.       } else {
1405.           if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
                     ^
1406.               BIO_printf(bio_err, "unable to load number from %s\n",
1407.                          serialfile);

apps/apps.c:1406:13: Skipping BIO_printf(): empty list of specs
1404.       } else {
1405.           if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
1406.               BIO_printf(bio_err, "unable to load number from %s\n",
                    ^
1407.                          serialfile);
1408.               goto err;

apps/apps.c:1422:2: 
1420.           ai = NULL;
1421.       }
1422. >  err:
1423.       BIO_free(in);
1424.       ASN1_INTEGER_free(ai);

apps/apps.c:1423:5: 
1421.       }
1422.    err:
1423. >     BIO_free(in);
1424.       ASN1_INTEGER_free(ai);
1425.       return (ret);

crypto/bio/bio_lib.c:106:1: start of procedure BIO_free()
  104.   }
  105.   
  106. > int BIO_free(BIO *a)
  107.   {
  108.       int i;

crypto/bio/bio_lib.c:110:9: Taking false branch
  108.       int i;
  109.   
  110.       if (a == NULL)
                 ^
  111.           return (0);
  112.   

crypto/bio/bio_lib.c:113:5: 
  111.           return (0);
  112.   
  113. >     i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO);
  114.   #ifdef REF_PRINT
  115.       REF_PRINT("BIO", a);

crypto/lock.c:456:1: start of procedure CRYPTO_add_lock()
    454.   }
    455.   
    456. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
    457.                       int line)
    458.   {

crypto/lock.c:459:5: 
    457.                       int line)
    458.   {
    459. >     int ret = 0;
    460.   
    461.       if (add_lock_callback != NULL) {

crypto/lock.c:461:9: Taking false branch
    459.       int ret = 0;
    460.   
    461.       if (add_lock_callback != NULL) {
                   ^
    462.   #ifdef LOCK_DEBUG
    463.           int before = *pointer;

crypto/lock.c:477:9: 
    475.   #endif
    476.       } else {
    477. >         CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
    478.   
    479.           ret = *pointer + amount;

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/lock.c:479:9: 
    477.           CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
    478.   
    479. >         ret = *pointer + amount;
    480.   #ifdef LOCK_DEBUG
    481.           {

crypto/lock.c:490:9: 
    488.           }
    489.   #endif
    490. >         *pointer = ret;
    491.           CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
    492.       }

crypto/lock.c:491:9: 
    489.   #endif
    490.           *pointer = ret;
    491. >         CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
    492.       }
    493.       return (ret);

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/lock.c:493:5: 
    491.           CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
    492.       }
    493. >     return (ret);
    494.   }
    495.   

crypto/lock.c:494:1: return from a call to CRYPTO_add_lock
    492.       }
    493.       return (ret);
    494. > }
    495.   
    496.   const char *CRYPTO_get_lock_name(int type)

crypto/bio/bio_lib.c:117:9: Taking false branch
  115.       REF_PRINT("BIO", a);
  116.   #endif
  117.       if (i > 0)
                 ^
  118.           return (1);
  119.   #ifdef REF_CHECK

crypto/bio/bio_lib.c:125:10: Taking true branch
  123.       }
  124.   #endif
  125.       if ((a->callback != NULL) &&
                  ^
  126.           ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
  127.           return (i);

crypto/bio/bio_lib.c:126:10: Taking true branch
  124.   #endif
  125.       if ((a->callback != NULL) &&
  126.           ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
                  ^
  127.           return (i);
  128.   

crypto/bio/bio_lib.c:127:9: 
  125.       if ((a->callback != NULL) &&
  126.           ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
  127. >         return (i);
  128.   
  129.       CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);

crypto/bio/bio_lib.c:135:1: return from a call to BIO_free
  133.       OPENSSL_free(a);
  134.       return (1);
  135. > }
  136.   
  137.   void BIO_vfree(BIO *a)

apps/apps.c:1424:5: 
1422.    err:
1423.       BIO_free(in);
1424. >     ASN1_INTEGER_free(ai);
1425.       return (ret);
1426.   }

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

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

BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
{
    BIO *in = NULL;
    BIGNUM *ret = NULL;
    char buf[1024];
    ASN1_INTEGER *ai = NULL;
    ai = ASN1_INTEGER_new();
    if (ai == NULL)
        goto err;
    in = BIO_new_file(serialfile, "r");
    if (in == NULL) {
        if (!create) {
            perror(serialfile);
            goto err;
        }
        ERR_clear_error();
        ret = BN_new();
        if (ret == NULL || !rand_serial(ret, ai))
            BIO_printf(bio_err, "Out of memory\n");
    } else {
        if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
            BIO_printf(bio_err, "unable to load number from %s\n",
                       serialfile);
            goto err;
        }
        ret = ASN1_INTEGER_to_BN(ai, NULL);
        if (ret == NULL) {
            BIO_printf(bio_err,
                       "error converting number from bin to BIGNUM\n");
            goto err;
        }
    }
    if (ret && retai) {
        *retai = ai;
        ai = NULL;
    }
 err:
    BIO_free(in);
    ASN1_INTEGER_free(ai);
    return (ret);
}
['BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)\n{\n    BIO *in = NULL;\n    BIGNUM *ret = NULL;\n    char buf[1024];\n    ASN1_INTEGER *ai = NULL;\n    ai = ASN1_INTEGER_new();\n    if (ai == NULL)\n        goto err;\n    in = BIO_new_file(serialfile, "r");\n    if (in == NULL) {\n        if (!create) {\n            perror(serialfile);\n            goto err;\n        }\n        ERR_clear_error();\n        ret = BN_new();\n        if (ret == NULL || !rand_serial(ret, ai))\n            BIO_printf(bio_err, "Out of memory\\n");\n    } else {\n        if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {\n            BIO_printf(bio_err, "unable to load number from %s\\n",\n                       serialfile);\n            goto err;\n        }\n        ret = ASN1_INTEGER_to_BN(ai, NULL);\n        if (ret == NULL) {\n            BIO_printf(bio_err,\n                       "error converting number from bin to BIGNUM\\n");\n            goto err;\n        }\n    }\n    if (ret && retai) {\n        *retai = ai;\n        ai = NULL;\n    }\n err:\n    BIO_free(in);\n    ASN1_INTEGER_free(ai);\n    return (ret);\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)', '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#ifdef 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 BIO_free(BIO *a)\n{\n    int i;\n    if (a == NULL)\n        return (0);\n    i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO);\n#ifdef REF_PRINT\n    REF_PRINT("BIO", a);\n#endif\n    if (i > 0)\n        return (1);\n#ifdef REF_CHECK\n    if (i < 0) {\n        fprintf(stderr, "BIO_free, bad reference count\\n");\n        abort();\n    }\n#endif\n    if ((a->callback != NULL) &&\n        ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))\n        return (i);\n    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);\n    if ((a->method != NULL) && (a->method->destroy != NULL))\n        a->method->destroy(a);\n    OPENSSL_free(a);\n    return (1);\n}', 'int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,\n                    int line)\n{\n    int ret = 0;\n    if (add_lock_callback != NULL) {\n#ifdef LOCK_DEBUG\n        int before = *pointer;\n#endif\n        ret = add_lock_callback(pointer, amount, type, file, line);\n#ifdef LOCK_DEBUG\n        {\n            CRYPTO_THREADID id;\n            CRYPTO_THREADID_current(&id);\n            fprintf(stderr, "ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n                    CRYPTO_THREADID_hash(&id), before, amount, ret,\n                    CRYPTO_get_lock_name(type), file, line);\n        }\n#endif\n    } else {\n        CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);\n        ret = *pointer + amount;\n#ifdef LOCK_DEBUG\n        {\n            CRYPTO_THREADID id;\n            CRYPTO_THREADID_current(&id);\n            fprintf(stderr, "ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n                    CRYPTO_THREADID_hash(&id),\n                    *pointer, amount, ret,\n                    CRYPTO_get_lock_name(type), file, line);\n        }\n#endif\n        *pointer = ret;\n        CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);\n    }\n    return (ret);\n}', 'void CRYPTO_lock(int mode, int type, const char *file, int line)\n{\n#ifdef LOCK_DEBUG\n    {\n        CRYPTO_THREADID id;\n        char *rw_text, *operation_text;\n        if (mode & CRYPTO_LOCK)\n            operation_text = "lock  ";\n        else if (mode & CRYPTO_UNLOCK)\n            operation_text = "unlock";\n        else\n            operation_text = "ERROR ";\n        if (mode & CRYPTO_READ)\n            rw_text = "r";\n        else if (mode & CRYPTO_WRITE)\n            rw_text = "w";\n        else\n            rw_text = "ERROR";\n        CRYPTO_THREADID_current(&id);\n        fprintf(stderr, "lock:%08lx:(%s)%s %-18s %s:%d\\n",\n                CRYPTO_THREADID_hash(&id), rw_text, operation_text,\n                CRYPTO_get_lock_name(type), file, line);\n    }\n#endif\n    if (type < 0) {\n        if (dynlock_lock_callback != NULL) {\n            struct CRYPTO_dynlock_value *pointer\n                = CRYPTO_get_dynlock_value(type);\n            OPENSSL_assert(pointer != NULL);\n            dynlock_lock_callback(mode, pointer, file, line);\n            CRYPTO_destroy_dynlockid(type);\n        }\n    } else if (locking_callback != NULL)\n        locking_callback(mode, type, file, line);\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}']