ssl/s3_enc.c:197: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 156, column 10 is not reachable after line 197, column 5.
Showing all 75 steps of the trace


ssl/s3_enc.c:142:1: start of procedure ssl3_generate_key_block()
140.   #include <openssl/md5.h>
141.   
142. > static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
143.   {
144.       EVP_MD_CTX *m5;

ssl/s3_enc.c:147:5: 
145.       EVP_MD_CTX *s1;
146.       unsigned char buf[16], smd[SHA_DIGEST_LENGTH];
147. >     unsigned char c = 'A';
148.       unsigned int i, j, k;
149.       int ret = 0;

ssl/s3_enc.c:149:5: 
147.       unsigned char c = 'A';
148.       unsigned int i, j, k;
149. >     int ret = 0;
150.   
151.   #ifdef CHARSET_EBCDIC

ssl/s3_enc.c:154:5: 
152.       c = os_toascii[c];          /* 'A' in ASCII */
153.   #endif
154. >     k = 0;
155.       m5 = EVP_MD_CTX_new();
156.       s1 = EVP_MD_CTX_new();

ssl/s3_enc.c:155:5: 
153.   #endif
154.       k = 0;
155. >     m5 = EVP_MD_CTX_new();
156.       s1 = EVP_MD_CTX_new();
157.       if (m5 == NULL || s1 == NULL) {

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

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

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

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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

crypto/mem.c:129:5: 
      127.           return NULL;
      128.   
      129. >     allow_customize = 0;
      130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:139:24: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:140:5: 
      138.   #else
      139.       osslargused(file); osslargused(line);
      140. >     ret = malloc(num);
      141.   #endif
      142.   

crypto/mem.c:155:5: 
      153.   #endif
      154.   
      155. >     return ret;
      156.   }
      157.   

crypto/mem.c:156:1: return from a call to CRYPTO_malloc
      154.   
      155.       return ret;
      156. > }
      157.   
      158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:163:9: 
    161.   
    162.       if (ret != NULL)
    163. >         memset(ret, 0, num);
    164.       return ret;
    165.   }

crypto/mem.c:164:5: 
    162.       if (ret != NULL)
    163.           memset(ret, 0, num);
    164. >     return ret;
    165.   }
    166.   

crypto/mem.c:165:1: return from a call to CRYPTO_zalloc
    163.           memset(ret, 0, num);
    164.       return ret;
    165. > }
    166.   
    167.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

ssl/s3_enc.c:156:5: 
154.       k = 0;
155.       m5 = EVP_MD_CTX_new();
156. >     s1 = EVP_MD_CTX_new();
157.       if (m5 == NULL || s1 == NULL) {
158.           SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_MALLOC_FAILURE);

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

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

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

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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

crypto/mem.c:129:5: 
      127.           return NULL;
      128.   
      129. >     allow_customize = 0;
      130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:139:24: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:140:5: 
      138.   #else
      139.       osslargused(file); osslargused(line);
      140. >     ret = malloc(num);
      141.   #endif
      142.   

crypto/mem.c:155:5: 
      153.   #endif
      154.   
      155. >     return ret;
      156.   }
      157.   

crypto/mem.c:156:1: return from a call to CRYPTO_malloc
      154.   
      155.       return ret;
      156. > }
      157.   
      158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:163:9: 
    161.   
    162.       if (ret != NULL)
    163. >         memset(ret, 0, num);
    164.       return ret;
    165.   }

crypto/mem.c:164:5: 
    162.       if (ret != NULL)
    163.           memset(ret, 0, num);
    164. >     return ret;
    165.   }
    166.   

crypto/mem.c:165:1: return from a call to CRYPTO_zalloc
    163.           memset(ret, 0, num);
    164.       return ret;
    165. > }
    166.   
    167.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

ssl/s3_enc.c:157:9: Taking false branch
155.       m5 = EVP_MD_CTX_new();
156.       s1 = EVP_MD_CTX_new();
157.       if (m5 == NULL || s1 == NULL) {
               ^
158.           SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_MALLOC_FAILURE);
159.           goto err;

ssl/s3_enc.c:157:23: Taking false branch
155.       m5 = EVP_MD_CTX_new();
156.       s1 = EVP_MD_CTX_new();
157.       if (m5 == NULL || s1 == NULL) {
                             ^
158.           SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_MALLOC_FAILURE);
159.           goto err;

ssl/s3_enc.c:161:5: 
159.           goto err;
160.       }
161. >     EVP_MD_CTX_set_flags(m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
162.       for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {
163.           k++;

crypto/evp/evp_lib.c:507:1: start of procedure EVP_MD_CTX_set_flags()
  505.   }
  506.   
  507. > void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
  508.   {
  509.       ctx->flags |= flags;

crypto/evp/evp_lib.c:509:5: 
  507.   void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
  508.   {
  509. >     ctx->flags |= flags;
  510.   }
  511.   

crypto/evp/evp_lib.c:510:1: return from a call to EVP_MD_CTX_set_flags
  508.   {
  509.       ctx->flags |= flags;
  510. > }
  511.   
  512.   void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags)

ssl/s3_enc.c:162:10: 
160.       }
161.       EVP_MD_CTX_set_flags(m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
162. >     for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {
163.           k++;
164.           if (k > sizeof buf) {

ssl/s3_enc.c:162:17: Loop condition is false. Leaving loop
160.       }
161.       EVP_MD_CTX_set_flags(m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
162.       for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {
                       ^
163.           k++;
164.           if (k > sizeof buf) {

ssl/s3_enc.c:193:5: Skipping OPENSSL_cleanse(): method has no implementation
191.           km += MD5_DIGEST_LENGTH;
192.       }
193.       OPENSSL_cleanse(smd, sizeof(smd));
           ^
194.       ret = 1;
195.    err:

ssl/s3_enc.c:194:5: 
192.       }
193.       OPENSSL_cleanse(smd, sizeof(smd));
194. >     ret = 1;
195.    err:
196.       EVP_MD_CTX_free(m5);

ssl/s3_enc.c:195:2: 
193.       OPENSSL_cleanse(smd, sizeof(smd));
194.       ret = 1;
195. >  err:
196.       EVP_MD_CTX_free(m5);
197.       EVP_MD_CTX_free(s1);

ssl/s3_enc.c:196:5: 
194.       ret = 1;
195.    err:
196. >     EVP_MD_CTX_free(m5);
197.       EVP_MD_CTX_free(s1);
198.       return ret;

crypto/evp/digest.c:157:1: start of procedure EVP_MD_CTX_free()
  155.   }
  156.   
  157. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:159:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
             ^
  160.       OPENSSL_free(ctx);
  161.   }

crypto/evp/digest.c:160:5: 
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
  160. >     OPENSSL_free(ctx);
  161.   }
  162.   

crypto/mem.c:222:1: start of procedure CRYPTO_free()
    220.   }
    221.   
    222. > void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:224:9: Taking false branch
    222.   void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    225.           free_impl(str, file, line);
    226.           return;

crypto/mem.c:238:5: 
    236.       }
    237.   #else
    238. >     free(str);
    239.   #endif
    240.   }

crypto/mem.c:240:1: return from a call to CRYPTO_free
    238.       free(str);
    239.   #endif
    240. > }
    241.   
    242.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:161:1: return from a call to EVP_MD_CTX_free
  159.       EVP_MD_CTX_reset(ctx);
  160.       OPENSSL_free(ctx);
  161. > }
  162.   
  163.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

ssl/s3_enc.c:197:5: 
195.    err:
196.       EVP_MD_CTX_free(m5);
197. >     EVP_MD_CTX_free(s1);
198.       return ret;
199.   }

crypto/evp/digest.c:157:1: start of procedure EVP_MD_CTX_free()
  155.   }
  156.   
  157. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:159:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
             ^
  160.       OPENSSL_free(ctx);
  161.   }

crypto/evp/digest.c:160:5: 
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
  160. >     OPENSSL_free(ctx);
  161.   }
  162.   

crypto/mem.c:222:1: start of procedure CRYPTO_free()
    220.   }
    221.   
    222. > void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:224:9: Taking true branch
    222.   void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    225.           free_impl(str, file, line);
    226.           return;

crypto/mem.c:224:30: Taking true branch
    222.   void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    225.           free_impl(str, file, line);
    226.           return;

crypto/mem.c:225:9: Skipping __function_pointer__(): unresolved function pointer
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    225.           free_impl(str, file, line);
                   ^
    226.           return;
    227.       }

crypto/mem.c:226:9: 
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    225.           free_impl(str, file, line);
    226. >         return;
    227.       }
    228.   

crypto/mem.c:240:1: return from a call to CRYPTO_free
    238.       free(str);
    239.   #endif
    240. > }
    241.   
    242.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:161:1: return from a call to EVP_MD_CTX_free
  159.       EVP_MD_CTX_reset(ctx);
  160.       OPENSSL_free(ctx);
  161. > }
  162.   
  163.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
{
    EVP_MD_CTX *m5;
    EVP_MD_CTX *s1;
    unsigned char buf[16], smd[SHA_DIGEST_LENGTH];
    unsigned char c = 'A';
    unsigned int i, j, k;
    int ret = 0;
#ifdef CHARSET_EBCDIC
    c = os_toascii[c];
#endif
    k = 0;
    m5 = EVP_MD_CTX_new();
    s1 = EVP_MD_CTX_new();
    if (m5 == NULL || s1 == NULL) {
        SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_MALLOC_FAILURE);
        goto err;
    }
    EVP_MD_CTX_set_flags(m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
    for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {
        k++;
        if (k > sizeof buf) {
            SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_INTERNAL_ERROR);
            return 0;
        }
        for (j = 0; j < k; j++)
            buf[j] = c;
        c++;
        EVP_DigestInit_ex(s1, EVP_sha1(), NULL);
        EVP_DigestUpdate(s1, buf, k);
        EVP_DigestUpdate(s1, s->session->master_key,
                         s->session->master_key_length);
        EVP_DigestUpdate(s1, s->s3->server_random, SSL3_RANDOM_SIZE);
        EVP_DigestUpdate(s1, s->s3->client_random, SSL3_RANDOM_SIZE);
        EVP_DigestFinal_ex(s1, smd, NULL);
        EVP_DigestInit_ex(m5, EVP_md5(), NULL);
        EVP_DigestUpdate(m5, s->session->master_key,
                         s->session->master_key_length);
        EVP_DigestUpdate(m5, smd, SHA_DIGEST_LENGTH);
        if ((int)(i + MD5_DIGEST_LENGTH) > num) {
            EVP_DigestFinal_ex(m5, smd, NULL);
            memcpy(km, smd, (num - i));
        } else
            EVP_DigestFinal_ex(m5, km, NULL);
        km += MD5_DIGEST_LENGTH;
    }
    OPENSSL_cleanse(smd, sizeof(smd));
    ret = 1;
 err:
    EVP_MD_CTX_free(m5);
    EVP_MD_CTX_free(s1);
    return ret;
}
["static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)\n{\n    EVP_MD_CTX *m5;\n    EVP_MD_CTX *s1;\n    unsigned char buf[16], smd[SHA_DIGEST_LENGTH];\n    unsigned char c = 'A';\n    unsigned int i, j, k;\n    int ret = 0;\n#ifdef CHARSET_EBCDIC\n    c = os_toascii[c];\n#endif\n    k = 0;\n    m5 = EVP_MD_CTX_new();\n    s1 = EVP_MD_CTX_new();\n    if (m5 == NULL || s1 == NULL) {\n        SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_MALLOC_FAILURE);\n        goto err;\n    }\n    EVP_MD_CTX_set_flags(m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);\n    for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {\n        k++;\n        if (k > sizeof buf) {\n            SSLerr(SSL_F_SSL3_GENERATE_KEY_BLOCK, ERR_R_INTERNAL_ERROR);\n            return 0;\n        }\n        for (j = 0; j < k; j++)\n            buf[j] = c;\n        c++;\n        EVP_DigestInit_ex(s1, EVP_sha1(), NULL);\n        EVP_DigestUpdate(s1, buf, k);\n        EVP_DigestUpdate(s1, s->session->master_key,\n                         s->session->master_key_length);\n        EVP_DigestUpdate(s1, s->s3->server_random, SSL3_RANDOM_SIZE);\n        EVP_DigestUpdate(s1, s->s3->client_random, SSL3_RANDOM_SIZE);\n        EVP_DigestFinal_ex(s1, smd, NULL);\n        EVP_DigestInit_ex(m5, EVP_md5(), NULL);\n        EVP_DigestUpdate(m5, s->session->master_key,\n                         s->session->master_key_length);\n        EVP_DigestUpdate(m5, smd, SHA_DIGEST_LENGTH);\n        if ((int)(i + MD5_DIGEST_LENGTH) > num) {\n            EVP_DigestFinal_ex(m5, smd, NULL);\n            memcpy(km, smd, (num - i));\n        } else\n            EVP_DigestFinal_ex(m5, km, NULL);\n        km += MD5_DIGEST_LENGTH;\n    }\n    OPENSSL_cleanse(smd, sizeof(smd));\n    ret = 1;\n err:\n    EVP_MD_CTX_free(m5);\n    EVP_MD_CTX_free(s1);\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    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#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}', 'void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)\n{\n    ctx->flags |= flags;\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}']