test/evp_test.c:1257: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strdup()` at line 1250, column 14 is not reachable after line 1257, column 5.
Showing all 38 steps of the trace


test/evp_test.c:1245:1: start of procedure pkey_test_ctrl()
1243.   }
1244.   
1245. > static int pkey_test_ctrl(EVP_PKEY_CTX *pctx, const char *value)
1246.   {
1247.       int rv;

test/evp_test.c:1250:5: 
1248.       char *p, *tmpval;
1249.   
1250. >     tmpval = OPENSSL_strdup(value);
1251.       if (tmpval == NULL)
1252.           return 0;

crypto/o_str.c:28:1: start of procedure CRYPTO_strdup()
  26.   }
  27.   
  28. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  29.   {
  30.       char *ret;

crypto/o_str.c:33:9: Taking false branch
  31.       size_t size;
  32.   
  33.       if (str == NULL)
                ^
  34.           return NULL;
  35.       size = strlen(str) + 1;

crypto/o_str.c:35:5: 
  33.       if (str == NULL)
  34.           return NULL;
  35. >     size = strlen(str) + 1;
  36.       ret = CRYPTO_malloc(size, file, line);
  37.       if (ret != NULL)

crypto/o_str.c:36:5: 
  34.           return NULL;
  35.       size = strlen(str) + 1;
  36. >     ret = CRYPTO_malloc(size, file, line);
  37.       if (ret != NULL)
  38.           memcpy(ret, str, size);

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/o_str.c:37:9: Taking true branch
  35.       size = strlen(str) + 1;
  36.       ret = CRYPTO_malloc(size, file, line);
  37.       if (ret != NULL)
                ^
  38.           memcpy(ret, str, size);
  39.       return ret;

crypto/o_str.c:38:9: 
  36.       ret = CRYPTO_malloc(size, file, line);
  37.       if (ret != NULL)
  38. >         memcpy(ret, str, size);
  39.       return ret;
  40.   }

crypto/o_str.c:39:5: 
  37.       if (ret != NULL)
  38.           memcpy(ret, str, size);
  39. >     return ret;
  40.   }
  41.   

crypto/o_str.c:40:1: return from a call to CRYPTO_strdup
  38.           memcpy(ret, str, size);
  39.       return ret;
  40. > }
  41.   
  42.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

test/evp_test.c:1251:9: Taking false branch
1249.   
1250.       tmpval = OPENSSL_strdup(value);
1251.       if (tmpval == NULL)
                ^
1252.           return 0;
1253.       p = strchr(tmpval, ':');

test/evp_test.c:1253:5: 
1251.       if (tmpval == NULL)
1252.           return 0;
1253. >     p = strchr(tmpval, ':');
1254.       if (p != NULL)
1255.           *p++ = 0;

test/evp_test.c:1254:9: Taking false branch
1252.           return 0;
1253.       p = strchr(tmpval, ':');
1254.       if (p != NULL)
                ^
1255.           *p++ = 0;
1256.       rv = EVP_PKEY_CTX_ctrl_str(pctx, tmpval, p);

test/evp_test.c:1256:5: 
1254.       if (p != NULL)
1255.           *p++ = 0;
1256. >     rv = EVP_PKEY_CTX_ctrl_str(pctx, tmpval, p);
1257.       OPENSSL_free(tmpval);
1258.       return rv > 0;

crypto/evp/pmeth_lib.c:320:1: start of procedure EVP_PKEY_CTX_ctrl_str()
  318.   }
  319.   
  320. > int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx,
  321.                             const char *name, const char *value)
  322.   {

crypto/evp/pmeth_lib.c:323:10: Taking false branch
  321.                             const char *name, const char *value)
  322.   {
  323.       if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl_str) {
                  ^
  324.           EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_COMMAND_NOT_SUPPORTED);
  325.           return -2;

crypto/evp/pmeth_lib.c:323:18: Taking false branch
  321.                             const char *name, const char *value)
  322.   {
  323.       if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl_str) {
                          ^
  324.           EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_COMMAND_NOT_SUPPORTED);
  325.           return -2;

crypto/evp/pmeth_lib.c:323:33: Taking false branch
  321.                             const char *name, const char *value)
  322.   {
  323.       if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl_str) {
                                         ^
  324.           EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_COMMAND_NOT_SUPPORTED);
  325.           return -2;

crypto/evp/pmeth_lib.c:327:9: Taking false branch
  325.           return -2;
  326.       }
  327.       if (strcmp(name, "digest") == 0) {
                 ^
  328.           const EVP_MD *md;
  329.           if (value == NULL || (md = EVP_get_digestbyname(value)) == NULL) {

crypto/evp/pmeth_lib.c:335:5: Skipping __function_pointer__(): unresolved function pointer
  333.           return EVP_PKEY_CTX_set_signature_md(ctx, md);
  334.       }
  335.       return ctx->pmeth->ctrl_str(ctx, name, value);
             ^
  336.   }
  337.   

crypto/evp/pmeth_lib.c:336:1: return from a call to EVP_PKEY_CTX_ctrl_str
  334.       }
  335.       return ctx->pmeth->ctrl_str(ctx, name, value);
  336. > }
  337.   
  338.   /* Utility functions to send a string of hex string to a ctrl */

test/evp_test.c:1257:5: 
1255.           *p++ = 0;
1256.       rv = EVP_PKEY_CTX_ctrl_str(pctx, tmpval, p);
1257. >     OPENSSL_free(tmpval);
1258.       return rv > 0;
1259.   }

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)
