test/evp_test.c:1002: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strdup()` at line 1003, column 39 is not reachable after line 1002, column 16.
Showing all 40 steps of the trace


test/evp_test.c:978:1: start of procedure mac_test_parse()
976.   }
977.   
978. > static int mac_test_parse(EVP_TEST *t,
979.                             const char *keyword, const char *value)
980.   {

test/evp_test.c:981:5: 
979.                             const char *keyword, const char *value)
980.   {
981. >     MAC_DATA *mdata = t->data;
982.   
983.       if (strcmp(keyword, "Key") == 0)

test/evp_test.c:983:9: Taking false branch
981.       MAC_DATA *mdata = t->data;
982.   
983.       if (strcmp(keyword, "Key") == 0)
               ^
984.           return parse_bin(value, &mdata->key, &mdata->key_len);
985.       if (strcmp(keyword, "IV") == 0)

test/evp_test.c:985:9: Taking false branch
983.       if (strcmp(keyword, "Key") == 0)
984.           return parse_bin(value, &mdata->key, &mdata->key_len);
985.       if (strcmp(keyword, "IV") == 0)
               ^
986.           return parse_bin(value, &mdata->iv, &mdata->iv_len);
987.       if (strcmp(keyword, "Custom") == 0)

test/evp_test.c:987:9: Taking false branch
985.       if (strcmp(keyword, "IV") == 0)
986.           return parse_bin(value, &mdata->iv, &mdata->iv_len);
987.       if (strcmp(keyword, "Custom") == 0)
               ^
988.           return parse_bin(value, &mdata->custom, &mdata->custom_len);
989.       if (strcmp(keyword, "Salt") == 0)

test/evp_test.c:989:9: Taking false branch
987.       if (strcmp(keyword, "Custom") == 0)
988.           return parse_bin(value, &mdata->custom, &mdata->custom_len);
989.       if (strcmp(keyword, "Salt") == 0)
               ^
990.           return parse_bin(value, &mdata->salt, &mdata->salt_len);
991.       if (strcmp(keyword, "Algorithm") == 0) {

test/evp_test.c:991:9: Taking false branch
989.       if (strcmp(keyword, "Salt") == 0)
990.           return parse_bin(value, &mdata->salt, &mdata->salt_len);
991.       if (strcmp(keyword, "Algorithm") == 0) {
               ^
992.           mdata->alg = OPENSSL_strdup(value);
993.           if (!mdata->alg)

test/evp_test.c:997:9: Taking false branch
995.           return 1;
996.       }
997.       if (strcmp(keyword, "Input") == 0)
                ^
998.           return parse_bin(value, &mdata->input, &mdata->input_len);
999.       if (strcmp(keyword, "Output") == 0)

test/evp_test.c:999:9: Taking false branch
997.       if (strcmp(keyword, "Input") == 0)
998.           return parse_bin(value, &mdata->input, &mdata->input_len);
999.       if (strcmp(keyword, "Output") == 0)
                ^
1000.           return parse_bin(value, &mdata->output, &mdata->output_len);
1001.       if (strcmp(keyword, "Ctrl") == 0)

test/evp_test.c:1001:9: Taking true branch
999.       if (strcmp(keyword, "Output") == 0)
1000.           return parse_bin(value, &mdata->output, &mdata->output_len);
1001.       if (strcmp(keyword, "Ctrl") == 0)
                ^
1002.           return sk_OPENSSL_STRING_push(mdata->controls,
1003.                                         OPENSSL_strdup(value)) != 0;

test/evp_test.c:1002:16: 
1000.           return parse_bin(value, &mdata->output, &mdata->output_len);
1001.       if (strcmp(keyword, "Ctrl") == 0)
1002. >         return sk_OPENSSL_STRING_push(mdata->controls,
1003.                                         OPENSSL_strdup(value)) != 0;
1004.       return 0;

crypto/o_str.c:15:1: start of procedure CRYPTO_strdup()
  13.   #include "internal/cryptlib.h"
  14.   
  15. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  16.   {
  17.       char *ret;

crypto/o_str.c:19:9: Taking false branch
  17.       char *ret;
  18.   
  19.       if (str == NULL)
                ^
  20.           return NULL;
  21.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:21:5: 
  19.       if (str == NULL)
  20.           return NULL;
  21. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  22.       if (ret != NULL)
  23.           strcpy(ret, str);

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
    190.   #endif
    191.   
    192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    193.   {
    194.       void *ret = NULL;

crypto/mem.c:194:5: 
    192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    193.   {
    194. >     void *ret = NULL;
    195.   
    196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking false branch
    195.   
    196.       INCREMENT(malloc_count);
    197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    198.           return malloc_impl(num, file, line);
    199.   

crypto/mem.c:200:9: Taking false branch
    198.           return malloc_impl(num, file, line);
    199.   
    200.       if (num == 0)
                   ^
    201.           return NULL;
    202.   

crypto/mem.c:204:9: Taking false branch
    202.   
    203.       FAILTEST();
    204.       if (allow_customize) {
                   ^
    205.           /*
    206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:221:5: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:221:19: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:222:5: 
    220.   #else
    221.       (void)(file); (void)(line);
    222. >     ret = malloc(num);
    223.   #endif
    224.   

crypto/mem.c:225:5: 
    223.   #endif
    224.   
    225. >     return ret;
    226.   }
    227.   

crypto/mem.c:226:1: return from a call to CRYPTO_malloc
    224.   
    225.       return ret;
    226. > }
    227.   
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:22:9: Taking true branch
  20.           return NULL;
  21.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  22.       if (ret != NULL)
                ^
  23.           strcpy(ret, str);
  24.       return ret;

crypto/o_str.c:23:9: 
  21.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  22.       if (ret != NULL)
  23. >         strcpy(ret, str);
  24.       return ret;
  25.   }

crypto/o_str.c:24:5: 
  22.       if (ret != NULL)
  23.           strcpy(ret, str);
  24. >     return ret;
  25.   }
  26.   

crypto/o_str.c:25:1: return from a call to CRYPTO_strdup
  23.           strcpy(ret, str);
  24.       return ret;
  25. > }
  26.   
  27.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

include/openssl/safestack.h:159:1: start of procedure sk_OPENSSL_STRING_push()
  157.    * dealt with in the autogenerated macros below.
  158.    */
  159. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
  160.   DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
  161.   

crypto/stack/stack.c:325:1: start of procedure OPENSSL_sk_push()
    323.   }
    324.   
    325. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    326.   {
    327.       if (st == NULL)

crypto/stack/stack.c:327:9: Taking false branch
    325.   int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    326.   {
    327.       if (st == NULL)
                   ^
    328.           return -1;
    329.       return OPENSSL_sk_insert(st, data, st->num);

crypto/stack/stack.c:329:5: 
    327.       if (st == NULL)
    328.           return -1;
    329. >     return OPENSSL_sk_insert(st, data, st->num);
    330.   }
    331.   

crypto/stack/stack.c:236:1: start of procedure OPENSSL_sk_insert()
      234.   }
      235.   
      236. > int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)
      237.   {
      238.       if (st == NULL || st->num == max_nodes)

crypto/stack/stack.c:238:9: Taking false branch
      236.   int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)
      237.   {
      238.       if (st == NULL || st->num == max_nodes)
                     ^
      239.           return 0;
      240.   

crypto/stack/stack.c:238:23: Taking false branch
      236.   int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)
      237.   {
      238.       if (st == NULL || st->num == max_nodes)
                                   ^
      239.           return 0;
      240.   

crypto/stack/stack.c:241:10: Taking true branch
      239.           return 0;
      240.   
      241.       if (!sk_reserve(st, 1, 0))
                      ^
      242.           return 0;
      243.   

crypto/stack/stack.c:242:9: 
      240.   
      241.       if (!sk_reserve(st, 1, 0))
      242. >         return 0;
      243.   
      244.       if ((loc >= st->num) || (loc < 0)) {

crypto/stack/stack.c:254:1: return from a call to OPENSSL_sk_insert
      252.       st->sorted = 0;
      253.       return st->num;
      254. > }
      255.   
      256.   static ossl_inline void *internal_delete(OPENSSL_STACK *st, int loc)

crypto/stack/stack.c:330:1: return from a call to OPENSSL_sk_push
    328.           return -1;
    329.       return OPENSSL_sk_insert(st, data, st->num);
    330. > }
    331.   
    332.   int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)

include/openssl/safestack.h:159:1: return from a call to sk_OPENSSL_STRING_push
  157.    * dealt with in the autogenerated macros below.
  158.    */
  159. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
  160.   DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
  161.   
