ssl/ssl_lib.c:3763: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 3754, column 11 is not reachable after line 3763, column 5.
Showing all 71 steps of the trace


ssl/ssl_lib.c:3745:1: start of procedure ssl_handshake_hash()
3743.   
3744.   /* Retrieve handshake hashes */
3745. > int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)
3746.   {
3747.       EVP_MD_CTX *ctx = NULL;

ssl/ssl_lib.c:3747:5: 
3745.   int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)
3746.   {
3747. >     EVP_MD_CTX *ctx = NULL;
3748.       EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3749.       int ret = EVP_MD_CTX_size(hdgst);

ssl/ssl_lib.c:3748:5: 
3746.   {
3747.       EVP_MD_CTX *ctx = NULL;
3748. >     EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3749.       int ret = EVP_MD_CTX_size(hdgst);
3750.       if (ret < 0 || ret > outlen) {

ssl/ssl_lib.c:3749:5: 
3747.       EVP_MD_CTX *ctx = NULL;
3748.       EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3749. >     int ret = EVP_MD_CTX_size(hdgst);
3750.       if (ret < 0 || ret > outlen) {
3751.           ret = 0;

crypto/evp/evp_lib.c:439:1: start of procedure EVP_MD_CTX_md()
  437.   }
  438.   
  439. > const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
  440.   {
  441.       if (!ctx)

crypto/evp/evp_lib.c:441:10: Taking false branch
  439.   const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
  440.   {
  441.       if (!ctx)
                  ^
  442.           return NULL;
  443.       return ctx->digest;

crypto/evp/evp_lib.c:443:5: 
  441.       if (!ctx)
  442.           return NULL;
  443. >     return ctx->digest;
  444.   }
  445.   

crypto/evp/evp_lib.c:444:1: return from a call to EVP_MD_CTX_md
  442.           return NULL;
  443.       return ctx->digest;
  444. > }
  445.   
  446.   EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx)

crypto/evp/evp_lib.c:301:1: start of procedure EVP_MD_size()
  299.   }
  300.   
  301. > int EVP_MD_size(const EVP_MD *md)
  302.   {
  303.       if (!md) {

crypto/evp/evp_lib.c:303:10: Taking false branch
  301.   int EVP_MD_size(const EVP_MD *md)
  302.   {
  303.       if (!md) {
                  ^
  304.           EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
  305.           return -1;

crypto/evp/evp_lib.c:307:5: 
  305.           return -1;
  306.       }
  307. >     return md->md_size;
  308.   }
  309.   

crypto/evp/evp_lib.c:308:1: return from a call to EVP_MD_size
  306.       }
  307.       return md->md_size;
  308. > }
  309.   
  310.   unsigned long EVP_MD_flags(const EVP_MD *md)

ssl/ssl_lib.c:3750:9: Taking false branch
3748.       EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3749.       int ret = EVP_MD_CTX_size(hdgst);
3750.       if (ret < 0 || ret > outlen) {
                ^
3751.           ret = 0;
3752.           goto err;

ssl/ssl_lib.c:3750:20: Taking false branch
3748.       EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3749.       int ret = EVP_MD_CTX_size(hdgst);
3750.       if (ret < 0 || ret > outlen) {
                           ^
3751.           ret = 0;
3752.           goto err;

ssl/ssl_lib.c:3754:5: 
3752.           goto err;
3753.       }
3754. >     ctx = EVP_MD_CTX_new();
3755.       if (ctx == NULL) {
3756.           ret = 0;

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:98:1: start of procedure CRYPTO_zalloc()
    96.   }
    97.   
    98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100. >     void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
      69.   }
      70.   
      71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      72.   {
      73.       void *ret = NULL;

crypto/mem.c:73:5: 
      71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      72.   {
      73. >     void *ret = NULL;
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
      73.       void *ret = NULL;
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                    ^
      76.           return malloc_impl(num, file, line);
      77.   

crypto/mem.c:78:9: Taking false branch
      76.           return malloc_impl(num, file, line);
      77.   
      78.       if (num <= 0)
                    ^
      79.           return NULL;
      80.   

crypto/mem.c:81:5: 
      79.           return NULL;
      80.   
      81. >     allow_customize = 0;
      82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
      89.       }
      90.   #else
      91. >     osslargused(file); osslargused(line);
      92.       ret = malloc(num);
      93.   #endif

crypto/mem.c:91:24: 
      89.       }
      90.   #else
      91. >     osslargused(file); osslargused(line);
      92.       ret = malloc(num);
      93.   #endif

crypto/mem.c:92:5: 
      90.   #else
      91.       osslargused(file); osslargused(line);
      92. >     ret = malloc(num);
      93.   #endif
      94.   

crypto/mem.c:95:5: 
      93.   #endif
      94.   
      95. >     return ret;
      96.   }
      97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
      94.   
      95.       return ret;
      96. > }
      97.   
      98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:102:9: Taking true branch
    100.       void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)
                   ^
    103.           memset(ret, 0, num);
    104.       return ret;

crypto/mem.c:103:9: 
    101.   
    102.       if (ret != NULL)
    103. >         memset(ret, 0, num);
    104.       return ret;
    105.   }

crypto/mem.c:104:5: 
    102.       if (ret != NULL)
    103.           memset(ret, 0, num);
    104. >     return ret;
    105.   }
    106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
    103.           memset(ret, 0, num);
    104.       return ret;
    105. > }
    106.   
    107.   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)

ssl/ssl_lib.c:3755:9: Taking false branch
3753.       }
3754.       ctx = EVP_MD_CTX_new();
3755.       if (ctx == NULL) {
                ^
3756.           ret = 0;
3757.           goto err;

ssl/ssl_lib.c:3759:10: 
3757.           goto err;
3758.       }
3759. >     if (!EVP_MD_CTX_copy_ex(ctx, hdgst)
3760.           || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
3761.           ret = 0;

crypto/evp/digest.c:183:1: start of procedure EVP_MD_CTX_copy_ex()
  181.   }
  182.   
  183. > int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  184.   {
  185.       unsigned char *tmp_buf;

crypto/evp/digest.c:186:10: Taking false branch
  184.   {
  185.       unsigned char *tmp_buf;
  186.       if ((in == NULL) || (in->digest == NULL)) {
                  ^
  187.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  188.           return 0;

crypto/evp/digest.c:186:26: Taking false branch
  184.   {
  185.       unsigned char *tmp_buf;
  186.       if ((in == NULL) || (in->digest == NULL)) {
                                  ^
  187.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  188.           return 0;

crypto/evp/digest.c:192:9: Taking true branch
  190.   #ifndef OPENSSL_NO_ENGINE
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192.       if (in->engine && !ENGINE_init(in->engine)) {
                 ^
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194.           return 0;

crypto/evp/digest.c:192:24: 
  190.   #ifndef OPENSSL_NO_ENGINE
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192. >     if (in->engine && !ENGINE_init(in->engine)) {
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194.           return 0;

crypto/engine/eng_init.c:76:1: start of procedure ENGINE_init()
    74.   
    75.   /* The API (locked) version of "init" */
    76. > int ENGINE_init(ENGINE *e)
    77.   {
    78.       int ret;

crypto/engine/eng_init.c:79:9: Taking false branch
    77.   {
    78.       int ret;
    79.       if (e == NULL) {
                  ^
    80.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER);
    81.           return 0;

crypto/engine/eng_init.c:83:10: 
    81.           return 0;
    82.       }
    83. >     if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85.           return 0;

crypto/threads_pthread.c:63:1: start of procedure CRYPTO_THREAD_run_once()
      61.   }
      62.   
      63. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      64.   {
      65.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:65:9: Taking true branch
      63.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      64.   {
      65.       if (pthread_once(once, init) != 0)
                    ^
      66.           return 0;
      67.   

crypto/threads_pthread.c:66:9: 
      64.   {
      65.       if (pthread_once(once, init) != 0)
      66. >         return 0;
      67.   
      68.       return 1;

crypto/threads_pthread.c:69:1: return from a call to CRYPTO_THREAD_run_once
      67.   
      68.       return 1;
      69. > }
      70.   
      71.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/engine/eng_init.c:83:10: Condition is false
    81.           return 0;
    82.       }
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
                   ^
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85.           return 0;

crypto/engine/eng_init.c:83:10: Taking true branch
    81.           return 0;
    82.       }
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
                   ^
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85.           return 0;

crypto/engine/eng_init.c:84:9: Skipping ERR_put_error(): empty list of specs
    82.       }
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
                  ^
    85.           return 0;
    86.       }

crypto/engine/eng_init.c:85:9: 
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85. >         return 0;
    86.       }
    87.       CRYPTO_THREAD_write_lock(global_engine_lock);

crypto/engine/eng_init.c:91:1: return from a call to ENGINE_init
    89.       CRYPTO_THREAD_unlock(global_engine_lock);
    90.       return ret;
    91. > }
    92.   
    93.   /* The API (locked) version of "finish" */

crypto/evp/digest.c:192:24: Taking true branch
  190.   #ifndef OPENSSL_NO_ENGINE
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192.       if (in->engine && !ENGINE_init(in->engine)) {
                                ^
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194.           return 0;

crypto/evp/digest.c:193:9: Skipping ERR_put_error(): empty list of specs
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192.       if (in->engine && !ENGINE_init(in->engine)) {
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
                 ^
  194.           return 0;
  195.       }

crypto/evp/digest.c:194:9: 
  192.       if (in->engine && !ENGINE_init(in->engine)) {
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194. >         return 0;
  195.       }
  196.   #endif

crypto/evp/digest.c:240:1: return from a call to EVP_MD_CTX_copy_ex
  238.   
  239.       return 1;
  240. > }
  241.   
  242.   int EVP_Digest(const void *data, size_t count,

ssl/ssl_lib.c:3759:10: Taking true branch
3757.           goto err;
3758.       }
3759.       if (!EVP_MD_CTX_copy_ex(ctx, hdgst)
                 ^
3760.           || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
3761.           ret = 0;

ssl/ssl_lib.c:3761:9: 
3759.       if (!EVP_MD_CTX_copy_ex(ctx, hdgst)
3760.           || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
3761. >         ret = 0;
3762.    err:
3763.       EVP_MD_CTX_free(ctx);

ssl/ssl_lib.c:3762:2: 
3760.           || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
3761.           ret = 0;
3762. >  err:
3763.       EVP_MD_CTX_free(ctx);
3764.       return ret;

ssl/ssl_lib.c:3763:5: 
3761.           ret = 0;
3762.    err:
3763. >     EVP_MD_CTX_free(ctx);
3764.       return ret;
3765.   }

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:163:1: start of procedure CRYPTO_free()
    161.   }
    162.   
    163. > void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:165:30: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
                   ^
    167.           return;
    168.       }

crypto/mem.c:167:9: 
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
    167. >         return;
    168.       }
    169.   

crypto/mem.c:181:1: return from a call to CRYPTO_free
    179.       free(str);
    180.   #endif
    181. > }
    182.   
    183.   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)

int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)
{
    EVP_MD_CTX *ctx = NULL;
    EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
    int ret = EVP_MD_CTX_size(hdgst);
    if (ret < 0 || ret > outlen) {
        ret = 0;
        goto err;
    }
    ctx = EVP_MD_CTX_new();
    if (ctx == NULL) {
        ret = 0;
        goto err;
    }
    if (!EVP_MD_CTX_copy_ex(ctx, hdgst)
        || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
        ret = 0;
 err:
    EVP_MD_CTX_free(ctx);
    return ret;
}
['int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)\n{\n    EVP_MD_CTX *ctx = NULL;\n    EVP_MD_CTX *hdgst = s->s3->handshake_dgst;\n    int ret = EVP_MD_CTX_size(hdgst);\n    if (ret < 0 || ret > outlen) {\n        ret = 0;\n        goto err;\n    }\n    ctx = EVP_MD_CTX_new();\n    if (ctx == NULL) {\n        ret = 0;\n        goto err;\n    }\n    if (!EVP_MD_CTX_copy_ex(ctx, hdgst)\n        || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)\n        ret = 0;\n err:\n    EVP_MD_CTX_free(ctx);\n    return ret;\n}', 'const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)\n{\n    if (!ctx)\n        return NULL;\n    return ctx->digest;\n}', 'int EVP_MD_size(const EVP_MD *md)\n{\n    if (!md) {\n        EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);\n        return -1;\n    }\n    return md->md_size;\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    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    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 EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)\n{\n    unsigned char *tmp_buf;\n    if ((in == NULL) || (in->digest == NULL)) {\n        EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);\n        return 0;\n    }\n#ifndef OPENSSL_NO_ENGINE\n    if (in->engine && !ENGINE_init(in->engine)) {\n        EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);\n        return 0;\n    }\n#endif\n    if (out->digest == in->digest) {\n        tmp_buf = out->md_data;\n        EVP_MD_CTX_set_flags(out, EVP_MD_CTX_FLAG_REUSE);\n    } else\n        tmp_buf = NULL;\n    EVP_MD_CTX_reset(out);\n    memcpy(out, in, sizeof(*out));\n    out->md_data = NULL;\n    out->pctx = NULL;\n    if (in->md_data && out->digest->ctx_size) {\n        if (tmp_buf)\n            out->md_data = tmp_buf;\n        else {\n            out->md_data = OPENSSL_malloc(out->digest->ctx_size);\n            if (out->md_data == NULL) {\n                EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_MALLOC_FAILURE);\n                return 0;\n            }\n        }\n        memcpy(out->md_data, in->md_data, out->digest->ctx_size);\n    }\n    out->update = in->update;\n    if (in->pctx) {\n        out->pctx = EVP_PKEY_CTX_dup(in->pctx);\n        if (!out->pctx) {\n            EVP_MD_CTX_reset(out);\n            return 0;\n        }\n    }\n    if (out->digest->copy)\n        return out->digest->copy(out, in);\n    return 1;\n}', 'int ENGINE_init(ENGINE *e)\n{\n    int ret;\n    if (e == NULL) {\n        ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER);\n        return 0;\n    }\n    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {\n        ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);\n        return 0;\n    }\n    CRYPTO_THREAD_write_lock(global_engine_lock);\n    ret = engine_unlocked_init(e);\n    CRYPTO_THREAD_unlock(global_engine_lock);\n    return ret;\n}', 'int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))\n{\n    if (pthread_once(once, init) != 0)\n        return 0;\n    return 1;\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}']