crypto/ocsp/ocsp_ext.c:324: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 315, column 15 is not reachable after line 324, column 10.
Showing all 47 steps of the trace


crypto/ocsp/ocsp_ext.c:300:1: start of procedure ocsp_add1_nonce()
298.    */
299.   
300. > static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts,
301.                              unsigned char *val, int len)
302.   {

crypto/ocsp/ocsp_ext.c:305:5: 
303.       unsigned char *tmpval;
304.       ASN1_OCTET_STRING os;
305. >     int ret = 0;
306.       if (len <= 0)
307.           len = OCSP_DEFAULT_NONCE_LENGTH;

crypto/ocsp/ocsp_ext.c:306:9: Taking false branch
304.       ASN1_OCTET_STRING os;
305.       int ret = 0;
306.       if (len <= 0)
               ^
307.           len = OCSP_DEFAULT_NONCE_LENGTH;
308.       /*

crypto/ocsp/ocsp_ext.c:314:5: 
312.        * relies on library internals.
313.        */
314. >     os.length = ASN1_object_size(0, len, V_ASN1_OCTET_STRING);
315.       os.data = OPENSSL_malloc(os.length);
316.       if (os.data == NULL)

crypto/asn1/asn1_lib.c:256:1: start of procedure ASN1_object_size()
  254.   }
  255.   
  256. > int ASN1_object_size(int constructed, int length, int tag)
  257.   {
  258.       int ret;

crypto/asn1/asn1_lib.c:260:5: 
  258.       int ret;
  259.   
  260. >     ret = length;
  261.       ret++;
  262.       if (tag >= 31) {

crypto/asn1/asn1_lib.c:261:5: 
  259.   
  260.       ret = length;
  261. >     ret++;
  262.       if (tag >= 31) {
  263.           while (tag > 0) {

crypto/asn1/asn1_lib.c:262:9: Taking false branch
  260.       ret = length;
  261.       ret++;
  262.       if (tag >= 31) {
                 ^
  263.           while (tag > 0) {
  264.               tag >>= 7;

crypto/asn1/asn1_lib.c:268:9: Taking false branch
  266.           }
  267.       }
  268.       if (constructed == 2)
                 ^
  269.           return ret + 3;
  270.       ret++;

crypto/asn1/asn1_lib.c:270:5: 
  268.       if (constructed == 2)
  269.           return ret + 3;
  270. >     ret++;
  271.       if (length > 127) {
  272.           while (length > 0) {

crypto/asn1/asn1_lib.c:271:9: Taking true branch
  269.           return ret + 3;
  270.       ret++;
  271.       if (length > 127) {
                 ^
  272.           while (length > 0) {
  273.               length >>= 8;

crypto/asn1/asn1_lib.c:272:16: Loop condition is true. Entering loop body
  270.       ret++;
  271.       if (length > 127) {
  272.           while (length > 0) {
                        ^
  273.               length >>= 8;
  274.               ret++;

crypto/asn1/asn1_lib.c:273:13: 
  271.       if (length > 127) {
  272.           while (length > 0) {
  273. >             length >>= 8;
  274.               ret++;
  275.           }

crypto/asn1/asn1_lib.c:274:13: 
  272.           while (length > 0) {
  273.               length >>= 8;
  274. >             ret++;
  275.           }
  276.       }

crypto/asn1/asn1_lib.c:272:16: Loop condition is true. Entering loop body
  270.       ret++;
  271.       if (length > 127) {
  272.           while (length > 0) {
                        ^
  273.               length >>= 8;
  274.               ret++;

crypto/asn1/asn1_lib.c:273:13: 
  271.       if (length > 127) {
  272.           while (length > 0) {
  273. >             length >>= 8;
  274.               ret++;
  275.           }

crypto/asn1/asn1_lib.c:274:13: 
  272.           while (length > 0) {
  273.               length >>= 8;
  274. >             ret++;
  275.           }
  276.       }

crypto/asn1/asn1_lib.c:272:16: Loop condition is false. Leaving loop
  270.       ret++;
  271.       if (length > 127) {
  272.           while (length > 0) {
                        ^
  273.               length >>= 8;
  274.               ret++;

crypto/asn1/asn1_lib.c:277:5: 
  275.           }
  276.       }
  277. >     return (ret);
  278.   }
  279.   

crypto/asn1/asn1_lib.c:278:1: return from a call to ASN1_object_size
  276.       }
  277.       return (ret);
  278. > }
  279.   
  280.   int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str)

crypto/ocsp/ocsp_ext.c:315:5: 
313.        */
314.       os.length = ASN1_object_size(0, len, V_ASN1_OCTET_STRING);
315. >     os.data = OPENSSL_malloc(os.length);
316.       if (os.data == NULL)
317.           goto err;

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/ocsp/ocsp_ext.c:316:9: Taking false branch
314.       os.length = ASN1_object_size(0, len, V_ASN1_OCTET_STRING);
315.       os.data = OPENSSL_malloc(os.length);
316.       if (os.data == NULL)
               ^
317.           goto err;
318.       tmpval = os.data;

crypto/ocsp/ocsp_ext.c:318:5: 
316.       if (os.data == NULL)
317.           goto err;
318. >     tmpval = os.data;
319.       ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL);
320.       if (val)

crypto/ocsp/ocsp_ext.c:319:5: Skipping ASN1_put_object(): empty list of specs
317.           goto err;
318.       tmpval = os.data;
319.       ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL);
           ^
320.       if (val)
321.           memcpy(tmpval, val, len);

crypto/ocsp/ocsp_ext.c:320:9: Taking false branch
318.       tmpval = os.data;
319.       ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL);
320.       if (val)
               ^
321.           memcpy(tmpval, val, len);
322.       else if (RAND_bytes(tmpval, len) <= 0)

crypto/ocsp/ocsp_ext.c:322:14: 
320.       if (val)
321.           memcpy(tmpval, val, len);
322. >     else if (RAND_bytes(tmpval, len) <= 0)
323.           goto err;
324.       if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,

crypto/rand/rand_lib.c:155:1: start of procedure RAND_bytes()
  153.   }
  154.   
  155. > int RAND_bytes(unsigned char *buf, int num)
  156.   {
  157.       const RAND_METHOD *meth = RAND_get_rand_method();

crypto/rand/rand_lib.c:157:5: 
  155.   int RAND_bytes(unsigned char *buf, int num)
  156.   {
  157. >     const RAND_METHOD *meth = RAND_get_rand_method();
  158.       if (meth && meth->bytes)
  159.           return meth->bytes(buf, num);

crypto/rand/rand_lib.c:92:1: start of procedure RAND_get_rand_method()
    90.   }
    91.   
    92. > const RAND_METHOD *RAND_get_rand_method(void)
    93.   {
    94.       if (!default_RAND_meth) {

crypto/rand/rand_lib.c:94:10: Taking false branch
    92.   const RAND_METHOD *RAND_get_rand_method(void)
    93.   {
    94.       if (!default_RAND_meth) {
                   ^
    95.   #ifndef OPENSSL_NO_ENGINE
    96.           ENGINE *e = ENGINE_get_default_RAND();

crypto/rand/rand_lib.c:110:5: 
    108.               default_RAND_meth = RAND_OpenSSL();
    109.       }
    110. >     return default_RAND_meth;
    111.   }
    112.   

crypto/rand/rand_lib.c:111:1: return from a call to RAND_get_rand_method
    109.       }
    110.       return default_RAND_meth;
    111. > }
    112.   
    113.   #ifndef OPENSSL_NO_ENGINE

crypto/rand/rand_lib.c:158:9: Taking true branch
  156.   {
  157.       const RAND_METHOD *meth = RAND_get_rand_method();
  158.       if (meth && meth->bytes)
                 ^
  159.           return meth->bytes(buf, num);
  160.       return (-1);

crypto/rand/rand_lib.c:158:17: Taking true branch
  156.   {
  157.       const RAND_METHOD *meth = RAND_get_rand_method();
  158.       if (meth && meth->bytes)
                         ^
  159.           return meth->bytes(buf, num);
  160.       return (-1);

crypto/rand/rand_lib.c:159:9: Skipping __function_pointer__(): unresolved function pointer
  157.       const RAND_METHOD *meth = RAND_get_rand_method();
  158.       if (meth && meth->bytes)
  159.           return meth->bytes(buf, num);
                 ^
  160.       return (-1);
  161.   }

crypto/rand/rand_lib.c:161:1: return from a call to RAND_bytes
  159.           return meth->bytes(buf, num);
  160.       return (-1);
  161. > }
  162.   
  163.   #if OPENSSL_API_COMPAT < 0x10100000L

crypto/ocsp/ocsp_ext.c:322:14: Taking false branch
320.       if (val)
321.           memcpy(tmpval, val, len);
322.       else if (RAND_bytes(tmpval, len) <= 0)
                    ^
323.           goto err;
324.       if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,

crypto/ocsp/ocsp_ext.c:324:10: Skipping X509V3_add1_i2d(): empty list of specs
322.       else if (RAND_bytes(tmpval, len) <= 0)
323.           goto err;
324.       if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,
                ^
325.                            &os, 0, X509V3_ADD_REPLACE))
326.           goto err;
