test/sslapitest.c:5105: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strdup()` at line 5091, column 20 is not reachable after line 5105, column 5.
Showing all 87 steps of the trace


test/sslapitest.c:5070:1: start of procedure create_new_vbase()
5068.   }
5069.   
5070. > static int create_new_vbase(char *userid, char *password)
5071.   {
5072.       BIGNUM *verifier = NULL, *salt = NULL;

test/sslapitest.c:5072:5: 
5070.   static int create_new_vbase(char *userid, char *password)
5071.   {
5072. >     BIGNUM *verifier = NULL, *salt = NULL;
5073.       const SRP_gN *lgN = NULL;
5074.       SRP_user_pwd *user_pwd = NULL;

test/sslapitest.c:5073:5: 
5071.   {
5072.       BIGNUM *verifier = NULL, *salt = NULL;
5073. >     const SRP_gN *lgN = NULL;
5074.       SRP_user_pwd *user_pwd = NULL;
5075.       int ret = 0;

test/sslapitest.c:5074:5: 
5072.       BIGNUM *verifier = NULL, *salt = NULL;
5073.       const SRP_gN *lgN = NULL;
5074. >     SRP_user_pwd *user_pwd = NULL;
5075.       int ret = 0;
5076.   

test/sslapitest.c:5075:5: 
5073.       const SRP_gN *lgN = NULL;
5074.       SRP_user_pwd *user_pwd = NULL;
5075. >     int ret = 0;
5076.   
5077.       lgN = SRP_get_default_gN(NULL);

test/sslapitest.c:5077:5: 
5075.       int ret = 0;
5076.   
5077. >     lgN = SRP_get_default_gN(NULL);
5078.       if (!TEST_ptr(lgN))
5079.           goto end;

crypto/srp/srp_lib.c:274:1: start of procedure SRP_get_default_gN()
  272.   }
  273.   
  274. > SRP_gN *SRP_get_default_gN(const char *id)
  275.   {
  276.       size_t i;

crypto/srp/srp_lib.c:278:9: Taking true branch
  276.       size_t i;
  277.   
  278.       if (id == NULL)
                 ^
  279.           return knowngN;
  280.       for (i = 0; i < KNOWN_GN_NUMBER; i++) {

crypto/srp/srp_lib.c:279:9: 
  277.   
  278.       if (id == NULL)
  279. >         return knowngN;
  280.       for (i = 0; i < KNOWN_GN_NUMBER; i++) {
  281.           if (strcmp(knowngN[i].id, id) == 0)

crypto/srp/srp_lib.c:285:1: return from a call to SRP_get_default_gN
  283.       }
  284.       return NULL;
  285. > }
  286.   #endif

test/sslapitest.c:5078:10: 
5076.   
5077.       lgN = SRP_get_default_gN(NULL);
5078. >     if (!TEST_ptr(lgN))
5079.           goto end;
5080.   

test/testutil/tests.c:229:1: start of procedure test_ptr()
  227.   }
  228.   
  229. > int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)

test/testutil/tests.c:231:9: Taking true branch
  229.   int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)
                 ^
  232.           return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:232:9: 
  230.   {
  231.       if (p != NULL)
  232. >         return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;

test/testutil/tests.c:235:1: return from a call to test_ptr
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;
  235. > }
  236.   
  237.   int test_true(const char *file, int line, const char *s, int b)

test/sslapitest.c:5078:10: Taking false branch
5076.   
5077.       lgN = SRP_get_default_gN(NULL);
5078.       if (!TEST_ptr(lgN))
                 ^
5079.           goto end;
5080.   

test/sslapitest.c:5081:10: Condition is true
5079.           goto end;
5080.   
5081.       if (!TEST_true(SRP_create_verifier_BN(userid, password, &salt, &verifier,
                 ^
5082.                                             lgN->N, lgN->g)))
5083.           goto end;

test/testutil/tests.c:237:1: start of procedure test_true()
  235.   }
  236.   
  237. > int test_true(const char *file, int line, const char *s, int b)
  238.   {
  239.       if (b)

test/testutil/tests.c:239:9: Taking true branch
  237.   int test_true(const char *file, int line, const char *s, int b)
  238.   {
  239.       if (b)
                 ^
  240.           return 1;
  241.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");

test/testutil/tests.c:240:9: 
  238.   {
  239.       if (b)
  240. >         return 1;
  241.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  242.       return 0;

test/testutil/tests.c:243:1: return from a call to test_true
  241.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  242.       return 0;
  243. > }
  244.   
  245.   int test_false(const char *file, int line, const char *s, int b)

test/sslapitest.c:5081:10: Taking false branch
5079.           goto end;
5080.   
5081.       if (!TEST_true(SRP_create_verifier_BN(userid, password, &salt, &verifier,
                 ^
5082.                                             lgN->N, lgN->g)))
5083.           goto end;

test/sslapitest.c:5085:5: 
5083.           goto end;
5084.   
5085. >     user_pwd = OPENSSL_zalloc(sizeof(*user_pwd));
5086.       if (!TEST_ptr(user_pwd))
5087.           goto end;

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
  226.   }
  227.   
  228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  229.   {
  230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
  228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  229.   {
  230. >     void *ret = CRYPTO_malloc(num, file, line);
  231.   
  232.       FAILTEST();

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 true branch
    202.   
    203.       FAILTEST();
    204.       if (allow_customize) {
                   ^
    205.           /*
    206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
    208.            * allocation.
    209.            */
    210. >         allow_customize = 0;
    211.       }
    212.   #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)

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/mem.c:233:9: Taking true branch
  231.   
  232.       FAILTEST();
  233.       if (ret != NULL)
                 ^
  234.           memset(ret, 0, num);
  235.       return ret;

crypto/mem.c:234:9: 
  232.       FAILTEST();
  233.       if (ret != NULL)
  234. >         memset(ret, 0, num);
  235.       return ret;
  236.   }

crypto/mem.c:235:5: 
  233.       if (ret != NULL)
  234.           memset(ret, 0, num);
  235. >     return ret;
  236.   }
  237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
  234.           memset(ret, 0, num);
  235.       return ret;
  236. > }
  237.   
  238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

test/sslapitest.c:5086:10: 
5084.   
5085.       user_pwd = OPENSSL_zalloc(sizeof(*user_pwd));
5086. >     if (!TEST_ptr(user_pwd))
5087.           goto end;
5088.   

test/testutil/tests.c:229:1: start of procedure test_ptr()
  227.   }
  228.   
  229. > int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)

test/testutil/tests.c:231:9: Taking true branch
  229.   int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)
                 ^
  232.           return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:232:9: 
  230.   {
  231.       if (p != NULL)
  232. >         return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;

test/testutil/tests.c:235:1: return from a call to test_ptr
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;
  235. > }
  236.   
  237.   int test_true(const char *file, int line, const char *s, int b)

test/sslapitest.c:5086:10: Taking false branch
5084.   
5085.       user_pwd = OPENSSL_zalloc(sizeof(*user_pwd));
5086.       if (!TEST_ptr(user_pwd))
                 ^
5087.           goto end;
5088.   

test/sslapitest.c:5089:5: 
5087.           goto end;
5088.   
5089. >     user_pwd->N = lgN->N;
5090.       user_pwd->g = lgN->g;
5091.       user_pwd->id = OPENSSL_strdup(userid);

test/sslapitest.c:5090:5: 
5088.   
5089.       user_pwd->N = lgN->N;
5090. >     user_pwd->g = lgN->g;
5091.       user_pwd->id = OPENSSL_strdup(userid);
5092.       if (!TEST_ptr(user_pwd->id))

test/sslapitest.c:5091:5: 
5089.       user_pwd->N = lgN->N;
5090.       user_pwd->g = lgN->g;
5091. >     user_pwd->id = OPENSSL_strdup(userid);
5092.       if (!TEST_ptr(user_pwd->id))
5093.           goto end;

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

crypto/o_str.c:31:9: Taking false branch
  29.       char *ret;
  30.   
  31.       if (str == NULL)
                ^
  32.           return NULL;
  33.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:33:5: 
  31.       if (str == NULL)
  32.           return NULL;
  33. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  34.       if (ret != NULL)
  35.           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:34:9: Taking true branch
  32.           return NULL;
  33.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  34.       if (ret != NULL)
                ^
  35.           strcpy(ret, str);
  36.       return ret;

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

crypto/o_str.c:36:5: 
  34.       if (ret != NULL)
  35.           strcpy(ret, str);
  36. >     return ret;
  37.   }
  38.   

crypto/o_str.c:37:1: return from a call to CRYPTO_strdup
  35.           strcpy(ret, str);
  36.       return ret;
  37. > }
  38.   
  39.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

test/sslapitest.c:5092:10: 
5090.       user_pwd->g = lgN->g;
5091.       user_pwd->id = OPENSSL_strdup(userid);
5092. >     if (!TEST_ptr(user_pwd->id))
5093.           goto end;
5094.   

test/testutil/tests.c:229:1: start of procedure test_ptr()
  227.   }
  228.   
  229. > int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)

test/testutil/tests.c:231:9: Taking true branch
  229.   int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)
                 ^
  232.           return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:232:9: 
  230.   {
  231.       if (p != NULL)
  232. >         return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;

test/testutil/tests.c:235:1: return from a call to test_ptr
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;
  235. > }
  236.   
  237.   int test_true(const char *file, int line, const char *s, int b)

test/sslapitest.c:5092:10: Taking false branch
5090.       user_pwd->g = lgN->g;
5091.       user_pwd->id = OPENSSL_strdup(userid);
5092.       if (!TEST_ptr(user_pwd->id))
                 ^
5093.           goto end;
5094.   

test/sslapitest.c:5095:5: 
5093.           goto end;
5094.   
5095. >     user_pwd->v = verifier;
5096.       user_pwd->s = salt;
5097.       verifier = salt = NULL;

test/sslapitest.c:5096:5: 
5094.   
5095.       user_pwd->v = verifier;
5096. >     user_pwd->s = salt;
5097.       verifier = salt = NULL;
5098.   

test/sslapitest.c:5097:5: 
5095.       user_pwd->v = verifier;
5096.       user_pwd->s = salt;
5097. >     verifier = salt = NULL;
5098.   
5099.       if (sk_SRP_user_pwd_insert(vbase->users_pwd, user_pwd, 0) == 0)

test/sslapitest.c:5099:9: 
5097.       verifier = salt = NULL;
5098.   
5099. >     if (sk_SRP_user_pwd_insert(vbase->users_pwd, user_pwd, 0) == 0)
5100.           goto end;
5101.       user_pwd = NULL;

include/openssl/srp.h:57:1: start of procedure sk_SRP_user_pwd_insert()
  55.   int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
  56.   
  57. > DEFINE_STACK_OF(SRP_user_pwd)
  58.   
  59.   typedef struct SRP_VBASE_st {

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

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

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

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

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

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

include/openssl/srp.h:57:1: return from a call to sk_SRP_user_pwd_insert
  55.   int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
  56.   
  57. > DEFINE_STACK_OF(SRP_user_pwd)
  58.   
  59.   typedef struct SRP_VBASE_st {

test/sslapitest.c:5099:9: Taking true branch
5097.       verifier = salt = NULL;
5098.   
5099.       if (sk_SRP_user_pwd_insert(vbase->users_pwd, user_pwd, 0) == 0)
                ^
5100.           goto end;
5101.       user_pwd = NULL;

test/sslapitest.c:5104:1: 
5102.   
5103.       ret = 1;
5104. > end:
5105.       SRP_user_pwd_free(user_pwd);
5106.       BN_free(salt);

test/sslapitest.c:5105:5: Skipping SRP_user_pwd_free(): empty list of specs
5103.       ret = 1;
5104.   end:
5105.       SRP_user_pwd_free(user_pwd);
            ^
5106.       BN_free(salt);
5107.       BN_free(verifier);

static int create_new_vbase(char *userid, char *password)
{
    BIGNUM *verifier = NULL, *salt = NULL;
    const SRP_gN *lgN = NULL;
    SRP_user_pwd *user_pwd = NULL;
    int ret = 0;
    lgN = SRP_get_default_gN(NULL);
    if (!TEST_ptr(lgN))
        goto end;
    if (!TEST_true(SRP_create_verifier_BN(userid, password, &salt, &verifier,
                                          lgN->N, lgN->g)))
        goto end;
    user_pwd = OPENSSL_zalloc(sizeof(*user_pwd));
    if (!TEST_ptr(user_pwd))
        goto end;
    user_pwd->N = lgN->N;
    user_pwd->g = lgN->g;
    user_pwd->id = OPENSSL_strdup(userid);
    if (!TEST_ptr(user_pwd->id))
        goto end;
    user_pwd->v = verifier;
    user_pwd->s = salt;
    verifier = salt = NULL;
    if (sk_SRP_user_pwd_insert(vbase->users_pwd, user_pwd, 0) == 0)
        goto end;
    user_pwd = NULL;
    ret = 1;
end:
    SRP_user_pwd_free(user_pwd);
    BN_free(salt);
    BN_free(verifier);
    return ret;
}
['static int create_new_vbase(char *userid, char *password)\n{\n    BIGNUM *verifier = NULL, *salt = NULL;\n    const SRP_gN *lgN = NULL;\n    SRP_user_pwd *user_pwd = NULL;\n    int ret = 0;\n    lgN = SRP_get_default_gN(NULL);\n    if (!TEST_ptr(lgN))\n        goto end;\n    if (!TEST_true(SRP_create_verifier_BN(userid, password, &salt, &verifier,\n                                          lgN->N, lgN->g)))\n        goto end;\n    user_pwd = OPENSSL_zalloc(sizeof(*user_pwd));\n    if (!TEST_ptr(user_pwd))\n        goto end;\n    user_pwd->N = lgN->N;\n    user_pwd->g = lgN->g;\n    user_pwd->id = OPENSSL_strdup(userid);\n    if (!TEST_ptr(user_pwd->id))\n        goto end;\n    user_pwd->v = verifier;\n    user_pwd->s = salt;\n    verifier = salt = NULL;\n    if (sk_SRP_user_pwd_insert(vbase->users_pwd, user_pwd, 0) == 0)\n        goto end;\n    user_pwd = NULL;\n    ret = 1;\nend:\n    SRP_user_pwd_free(user_pwd);\n    BN_free(salt);\n    BN_free(verifier);\n    return ret;\n}', 'SRP_gN *SRP_get_default_gN(const char *id)\n{\n    size_t i;\n    if (id == NULL)\n        return knowngN;\n    for (i = 0; i < KNOWN_GN_NUMBER; i++) {\n        if (strcmp(knowngN[i].id, id) == 0)\n            return knowngN + i;\n    }\n    return NULL;\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, "NULL", "!=", "%p", p);\n    return 0;\n}', 'int test_true(const char *file, int line, const char *s, int b)\n{\n    if (b)\n        return 1;\n    test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");\n    return 0;\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    INCREMENT(malloc_count);\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    if (allow_customize) {\n        allow_customize = 0;\n    }\n#if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)\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    (void)(file); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'char *CRYPTO_strdup(const char *str, const char* file, int line)\n{\n    char *ret;\n    if (str == NULL)\n        return NULL;\n    ret = CRYPTO_malloc(strlen(str) + 1, file, line);\n    if (ret != NULL)\n        strcpy(ret, str);\n    return ret;\n}', 'int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)\n{\n    if (st == NULL || st->num == max_nodes)\n        return 0;\n    if (!sk_reserve(st, 1, 0))\n        return 0;\n    if ((loc >= st->num) || (loc < 0)) {\n        st->data[st->num] = data;\n    } else {\n        memmove(&st->data[loc + 1], &st->data[loc],\n                sizeof(st->data[0]) * (st->num - loc));\n        st->data[loc] = data;\n    }\n    st->num++;\n    st->sorted = 0;\n    return st->num;\n}']