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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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