test/evp_extra_test.c:264: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 235, column 10 is not reachable after line 264, column 5.
Showing all 82 steps of the trace


test/evp_extra_test.c:227:1: start of procedure test_EVP_DigestSignInit()
225.   }
226.   
227. > static int test_EVP_DigestSignInit(void)
228.   {
229.       int ret = 0;

test/evp_extra_test.c:229:5: 
227.   static int test_EVP_DigestSignInit(void)
228.   {
229. >     int ret = 0;
230.       EVP_PKEY *pkey = NULL;
231.       unsigned char *sig = NULL;

test/evp_extra_test.c:230:5: 
228.   {
229.       int ret = 0;
230. >     EVP_PKEY *pkey = NULL;
231.       unsigned char *sig = NULL;
232.       size_t sig_len = 0;

test/evp_extra_test.c:231:5: 
229.       int ret = 0;
230.       EVP_PKEY *pkey = NULL;
231. >     unsigned char *sig = NULL;
232.       size_t sig_len = 0;
233.       EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;

test/evp_extra_test.c:232:5: 
230.       EVP_PKEY *pkey = NULL;
231.       unsigned char *sig = NULL;
232. >     size_t sig_len = 0;
233.       EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;
234.   

test/evp_extra_test.c:233:5: 
231.       unsigned char *sig = NULL;
232.       size_t sig_len = 0;
233. >     EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;
234.   
235.       if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())

test/evp_extra_test.c:235:10: 
233.       EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;
234.   
235. >     if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())
236.               || !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())
237.               || !TEST_ptr(pkey = load_example_rsa_key()))

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
    184.   }
    185.   
    186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    187.   {
    188.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:188:5: 
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    187.   {
    188. >     void *ret = CRYPTO_malloc(num, file, line);
    189.   
    190.       FAILTEST();

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
      156.   #endif
      157.   
      158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      159.   {
      160.       void *ret = NULL;

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

crypto/mem.c:162:9: Taking false branch
      160.       void *ret = NULL;
      161.   
      162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      163.           return malloc_impl(num, file, line);
      164.   

crypto/mem.c:165:9: Taking false branch
      163.           return malloc_impl(num, file, line);
      164.   
      165.       if (num == 0)
                     ^
      166.           return NULL;
      167.   

crypto/mem.c:169:5: 
      167.   
      168.       FAILTEST();
      169. >     allow_customize = 0;
      170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
      177.       }
      178.   #else
      179. >     osslargused(file); osslargused(line);
      180.       ret = malloc(num);
      181.   #endif

crypto/mem.c:179:24: 
      177.       }
      178.   #else
      179. >     osslargused(file); osslargused(line);
      180.       ret = malloc(num);
      181.   #endif

crypto/mem.c:180:5: 
      178.   #else
      179.       osslargused(file); osslargused(line);
      180. >     ret = malloc(num);
      181.   #endif
      182.   

crypto/mem.c:183:5: 
      181.   #endif
      182.   
      183. >     return ret;
      184.   }
      185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
      182.   
      183.       return ret;
      184. > }
      185.   
      186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:191:9: Taking true branch
    189.   
    190.       FAILTEST();
    191.       if (ret != NULL)
                   ^
    192.           memset(ret, 0, num);
    193.       return ret;

crypto/mem.c:192:9: 
    190.       FAILTEST();
    191.       if (ret != NULL)
    192. >         memset(ret, 0, num);
    193.       return ret;
    194.   }

crypto/mem.c:193:5: 
    191.       if (ret != NULL)
    192.           memset(ret, 0, num);
    193. >     return ret;
    194.   }
    195.   

crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
    192.           memset(ret, 0, num);
    193.       return ret;
    194. > }
    195.   
    196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

test/testutil.c:309:1: start of procedure test_ptr()
  307.   }
  308.   
  309. > int test_ptr(const char *file, int line, const char *s, const void *p)
  310.   {
  311.       if (p != NULL)

test/testutil.c:311:9: Taking true branch
  309.   int test_ptr(const char *file, int line, const char *s, const void *p)
  310.   {
  311.       if (p != NULL)
                 ^
  312.           return 1;
  313.       test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);

test/testutil.c:312:9: 
  310.   {
  311.       if (p != NULL)
  312. >         return 1;
  313.       test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);
  314.       return 0;

test/testutil.c:315:1: return from a call to test_ptr
  313.       test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);
  314.       return 0;
  315. > }
  316.   
  317.   int test_true(const char *file, int line, const char *s, int b)

test/evp_extra_test.c:235:10: Taking false branch
233.       EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;
234.   
235.       if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())
                ^
236.               || !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())
237.               || !TEST_ptr(pkey = load_example_rsa_key()))

test/evp_extra_test.c:236:17: 
234.   
235.       if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())
236. >             || !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())
237.               || !TEST_ptr(pkey = load_example_rsa_key()))
238.           goto out;

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
    184.   }
    185.   
    186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    187.   {
    188.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:188:5: 
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    187.   {
    188. >     void *ret = CRYPTO_malloc(num, file, line);
    189.   
    190.       FAILTEST();

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
      156.   #endif
      157.   
      158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      159.   {
      160.       void *ret = NULL;

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

crypto/mem.c:162:9: Taking true branch
      160.       void *ret = NULL;
      161.   
      162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      163.           return malloc_impl(num, file, line);
      164.   

crypto/mem.c:162:32: Taking true branch
      160.       void *ret = NULL;
      161.   
      162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                            ^
      163.           return malloc_impl(num, file, line);
      164.   

crypto/mem.c:163:9: Skipping __function_pointer__(): unresolved function pointer
      161.   
      162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
      163.           return malloc_impl(num, file, line);
                     ^
      164.   
      165.       if (num == 0)

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
      182.   
      183.       return ret;
      184. > }
      185.   
      186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:191:9: Taking false branch
    189.   
    190.       FAILTEST();
    191.       if (ret != NULL)
                   ^
    192.           memset(ret, 0, num);
    193.       return ret;

crypto/mem.c:193:5: 
    191.       if (ret != NULL)
    192.           memset(ret, 0, num);
    193. >     return ret;
    194.   }
    195.   

crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
    192.           memset(ret, 0, num);
    193.       return ret;
    194. > }
    195.   
    196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

test/testutil.c:309:1: start of procedure test_ptr()
  307.   }
  308.   
  309. > int test_ptr(const char *file, int line, const char *s, const void *p)
  310.   {
  311.       if (p != NULL)

test/testutil.c:311:9: Taking false branch
  309.   int test_ptr(const char *file, int line, const char *s, const void *p)
  310.   {
  311.       if (p != NULL)
                 ^
  312.           return 1;
  313.       test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);

test/testutil.c:313:5: 
  311.       if (p != NULL)
  312.           return 1;
  313. >     test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);
  314.       return 0;
  315.   }

test/testutil.c:202:1: start of procedure test_fail_message()
    200.   }
    201.   
    202. > static void test_fail_message(const char *prefix, const char *file, int line,
    203.                                 const char *type, const char *fmt, ...)
    204.   {

test/testutil.c:206:5: 
    204.   {
    205.       va_list ap;
    206. >     va_start(ap, fmt);
    207.       test_fail_message_va(prefix, file, line, type, fmt, ap);
    208.       va_end(ap);

test/testutil.c:207:5: 
    205.       va_list ap;
    206.       va_start(ap, fmt);
    207. >     test_fail_message_va(prefix, file, line, type, fmt, ap);
    208.       va_end(ap);
    209.   }

test/testutil.c:185:1: start of procedure test_fail_message_va()
      183.               PRINTF_FORMAT(5, 6);
      184.   
      185. > static void test_fail_message_va(const char *prefix, const char *file, int line,
      186.                                    const char *type, const char *fmt, va_list ap)
      187.   {

test/testutil.c:188:11: Condition is false
      186.                                    const char *type, const char *fmt, va_list ap)
      187.   {
      188.       fputs(prefix != NULL ? prefix : "ERROR", stderr);
                       ^
      189.       fputs(":", stderr);
      190.       if (type)

test/testutil.c:188:5: 
      186.                                    const char *type, const char *fmt, va_list ap)
      187.   {
      188. >     fputs(prefix != NULL ? prefix : "ERROR", stderr);
      189.       fputs(":", stderr);
      190.       if (type)

test/testutil.c:189:5: 
      187.   {
      188.       fputs(prefix != NULL ? prefix : "ERROR", stderr);
      189. >     fputs(":", stderr);
      190.       if (type)
      191.           fprintf(stderr, " (%s)", type);

test/testutil.c:190:9: Taking true branch
      188.       fputs(prefix != NULL ? prefix : "ERROR", stderr);
      189.       fputs(":", stderr);
      190.       if (type)
                     ^
      191.           fprintf(stderr, " (%s)", type);
      192.       if (fmt != NULL) {

test/testutil.c:191:9: 
      189.       fputs(":", stderr);
      190.       if (type)
      191. >         fprintf(stderr, " (%s)", type);
      192.       if (fmt != NULL) {
      193.           fputc(' ', stderr);

test/testutil.c:192:9: Taking true branch
      190.       if (type)
      191.           fprintf(stderr, " (%s)", type);
      192.       if (fmt != NULL) {
                     ^
      193.           fputc(' ', stderr);
      194.           vfprintf(stderr, fmt, ap);

test/testutil.c:193:9: 
      191.           fprintf(stderr, " (%s)", type);
      192.       if (fmt != NULL) {
      193. >         fputc(' ', stderr);
      194.           vfprintf(stderr, fmt, ap);
      195.       }

test/testutil.c:194:9: 
      192.       if (fmt != NULL) {
      193.           fputc(' ', stderr);
      194. >         vfprintf(stderr, fmt, ap);
      195.       }
      196.       if (file != NULL) {

test/testutil.c:196:9: Taking true branch
      194.           vfprintf(stderr, fmt, ap);
      195.       }
      196.       if (file != NULL) {
                     ^
      197.           fprintf(stderr, " @ %s:%d", file, line);
      198.       }

test/testutil.c:197:9: 
      195.       }
      196.       if (file != NULL) {
      197. >         fprintf(stderr, " @ %s:%d", file, line);
      198.       }
      199.       fputc('\n', stderr);

test/testutil.c:199:5: 
      197.           fprintf(stderr, " @ %s:%d", file, line);
      198.       }
      199. >     fputc('\n', stderr);
      200.   }
      201.   

test/testutil.c:200:1: return from a call to test_fail_message_va
      198.       }
      199.       fputc('\n', stderr);
      200. > }
      201.   
      202.   static void test_fail_message(const char *prefix, const char *file, int line,

test/testutil.c:208:5: 
    206.       va_start(ap, fmt);
    207.       test_fail_message_va(prefix, file, line, type, fmt, ap);
    208. >     va_end(ap);
    209.   }
    210.   

test/testutil.c:209:1: return from a call to test_fail_message
    207.       test_fail_message_va(prefix, file, line, type, fmt, ap);
    208.       va_end(ap);
    209. > }
    210.   
    211.   void test_info_c90(const char *desc, ...)

test/testutil.c:314:5: 
  312.           return 1;
  313.       test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);
  314. >     return 0;
  315.   }
  316.   

test/testutil.c:315:1: return from a call to test_ptr
  313.       test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);
  314.       return 0;
  315. > }
  316.   
  317.   int test_true(const char *file, int line, const char *s, int b)

test/evp_extra_test.c:236:17: Taking true branch
234.   
235.       if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())
236.               || !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())
                       ^
237.               || !TEST_ptr(pkey = load_example_rsa_key()))
238.           goto out;

test/evp_extra_test.c:263:2: 
261.       ret = 1;
262.   
263. >  out:
264.       EVP_MD_CTX_free(md_ctx);
265.       EVP_MD_CTX_free(md_ctx_verify);

test/evp_extra_test.c:264:5: 
262.   
263.    out:
264. >     EVP_MD_CTX_free(md_ctx);
265.       EVP_MD_CTX_free(md_ctx_verify);
266.       EVP_PKEY_free(pkey);

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

crypto/mem.c:253:1: start of procedure CRYPTO_free()
    251.   }
    252.   
    253. > void CRYPTO_free(void *str, const char *file, int line)
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:255:9: Taking true branch
    253.   void CRYPTO_free(void *str, const char *file, int line)
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    256.           free_impl(str, file, line);
    257.           return;

crypto/mem.c:255:30: Taking true branch
    253.   void CRYPTO_free(void *str, const char *file, int line)
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    256.           free_impl(str, file, line);
    257.           return;

crypto/mem.c:256:9: Skipping __function_pointer__(): unresolved function pointer
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    256.           free_impl(str, file, line);
                   ^
    257.           return;
    258.       }

crypto/mem.c:257:9: 
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    256.           free_impl(str, file, line);
    257. >         return;
    258.       }
    259.   

crypto/mem.c:271:1: return from a call to CRYPTO_free
    269.       free(str);
    270.   #endif
    271. > }
    272.   
    273.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

static int test_EVP_DigestSignInit(void)
{
    int ret = 0;
    EVP_PKEY *pkey = NULL;
    unsigned char *sig = NULL;
    size_t sig_len = 0;
    EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;
    if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())
            || !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())
            || !TEST_ptr(pkey = load_example_rsa_key()))
        goto out;
    if (!TEST_true(EVP_DigestSignInit(md_ctx, NULL, EVP_sha256(), NULL, pkey))
            || !TEST_true(EVP_DigestSignUpdate(md_ctx, kMsg, sizeof(kMsg))))
        goto out;
    if (!TEST_true(EVP_DigestSignFinal(md_ctx, NULL, &sig_len))
            || !TEST_size_t_eq(sig_len, (size_t)EVP_PKEY_size(pkey)))
        goto out;
    if (!TEST_ptr(sig = OPENSSL_malloc(sig_len))
            || !TEST_true(EVP_DigestSignFinal(md_ctx, sig, &sig_len)))
        goto out;
    if (!TEST_true(EVP_DigestVerifyInit(md_ctx_verify, NULL, EVP_sha256(),
                                        NULL, pkey))
            || !TEST_true(EVP_DigestVerifyUpdate(md_ctx_verify,
                                                 kMsg, sizeof(kMsg)))
            || !TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))
        goto out;
    ret = 1;
 out:
    EVP_MD_CTX_free(md_ctx);
    EVP_MD_CTX_free(md_ctx_verify);
    EVP_PKEY_free(pkey);
    OPENSSL_free(sig);
    return ret;
}
['static int test_EVP_DigestSignInit(void)\n{\n    int ret = 0;\n    EVP_PKEY *pkey = NULL;\n    unsigned char *sig = NULL;\n    size_t sig_len = 0;\n    EVP_MD_CTX *md_ctx, *md_ctx_verify = NULL;\n    if (!TEST_ptr(md_ctx = EVP_MD_CTX_new())\n            || !TEST_ptr(md_ctx_verify = EVP_MD_CTX_new())\n            || !TEST_ptr(pkey = load_example_rsa_key()))\n        goto out;\n    if (!TEST_true(EVP_DigestSignInit(md_ctx, NULL, EVP_sha256(), NULL, pkey))\n            || !TEST_true(EVP_DigestSignUpdate(md_ctx, kMsg, sizeof(kMsg))))\n        goto out;\n    if (!TEST_true(EVP_DigestSignFinal(md_ctx, NULL, &sig_len))\n            || !TEST_size_t_eq(sig_len, (size_t)EVP_PKEY_size(pkey)))\n        goto out;\n    if (!TEST_ptr(sig = OPENSSL_malloc(sig_len))\n            || !TEST_true(EVP_DigestSignFinal(md_ctx, sig, &sig_len)))\n        goto out;\n    if (!TEST_true(EVP_DigestVerifyInit(md_ctx_verify, NULL, EVP_sha256(),\n                                        NULL, pkey))\n            || !TEST_true(EVP_DigestVerifyUpdate(md_ctx_verify,\n                                                 kMsg, sizeof(kMsg)))\n            || !TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))\n        goto out;\n    ret = 1;\n out:\n    EVP_MD_CTX_free(md_ctx);\n    EVP_MD_CTX_free(md_ctx_verify);\n    EVP_PKEY_free(pkey);\n    OPENSSL_free(sig);\n    return ret;\n}', 'EVP_MD_CTX *EVP_MD_CTX_new(void)\n{\n    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    FAILTEST();\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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'int test_ptr(const char *file, int line, const char *s, const void *p)\n{\n    if (p != NULL)\n        return 1;\n    test_fail_message(NULL, file, line, "ptr", "%s [%p] != NULL", s, p);\n    return 0;\n}', 'static void test_fail_message(const char *prefix, const char *file, int line,\n                              const char *type, const char *fmt, ...)\n{\n    va_list ap;\n    va_start(ap, fmt);\n    test_fail_message_va(prefix, file, line, type, fmt, ap);\n    va_end(ap);\n}', 'static void test_fail_message_va(const char *prefix, const char *file, int line,\n                                 const char *type, const char *fmt, va_list ap)\n{\n    fputs(prefix != NULL ? prefix : "ERROR", stderr);\n    fputs(":", stderr);\n    if (type)\n        fprintf(stderr, " (%s)", type);\n    if (fmt != NULL) {\n        fputc(\' \', stderr);\n        vfprintf(stderr, fmt, ap);\n    }\n    if (file != NULL) {\n        fprintf(stderr, " @ %s:%d", file, line);\n    }\n    fputc(\'\\n\', stderr);\n}', 'void EVP_MD_CTX_free(EVP_MD_CTX *ctx)\n{\n    EVP_MD_CTX_reset(ctx);\n    OPENSSL_free(ctx);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']