crypto/srp/srp_vfy.c:515: error: MEMORY_LEAK
  memory dynamically allocated by call to `SRP_user_pwd_new()` at line 491, column 17 is not reachable after line 515, column 5.
Showing all 90 steps of the trace


crypto/srp/srp_vfy.c:470:1: start of procedure SRP_VBASE_get_by_user()
468.   }
469.   
470. > SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)
471.   {
472.       int i;

crypto/srp/srp_vfy.c:476:5: 
474.       unsigned char digv[SHA_DIGEST_LENGTH];
475.       unsigned char digs[SHA_DIGEST_LENGTH];
476. >     EVP_MD_CTX *ctxt = NULL;
477.   
478.       if (vb == NULL)

crypto/srp/srp_vfy.c:478:9: Taking false branch
476.       EVP_MD_CTX *ctxt = NULL;
477.   
478.       if (vb == NULL)
               ^
479.           return NULL;
480.       for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) {

crypto/srp/srp_vfy.c:480:10: 
478.       if (vb == NULL)
479.           return NULL;
480. >     for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) {
481.           user = sk_SRP_user_pwd_value(vb->users_pwd, i);
482.           if (strcmp(user->id, username) == 0)

crypto/srp/srp_vfy.c:480:17: 
478.       if (vb == NULL)
479.           return NULL;
480. >     for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) {
481.           user = sk_SRP_user_pwd_value(vb->users_pwd, i);
482.           if (strcmp(user->id, username) == 0)

include/openssl/srp.h:96:1: start of procedure sk_SRP_user_pwd_num()
  94.   } SRP_user_pwd;
  95.   
  96. > DEFINE_STACK_OF(SRP_user_pwd)
  97.   
  98.   typedef struct SRP_VBASE_st {

crypto/stack/stack.c:316:1: start of procedure sk_num()
    314.   }
    315.   
    316. > int sk_num(const _STACK *st)
    317.   {
    318.       if (st == NULL)

crypto/stack/stack.c:318:9: Taking true branch
    316.   int sk_num(const _STACK *st)
    317.   {
    318.       if (st == NULL)
                   ^
    319.           return -1;
    320.       return st->num;

crypto/stack/stack.c:319:9: 
    317.   {
    318.       if (st == NULL)
    319. >         return -1;
    320.       return st->num;
    321.   }

crypto/stack/stack.c:321:1: return from a call to sk_num
    319.           return -1;
    320.       return st->num;
    321. > }
    322.   
    323.   void *sk_value(const _STACK *st, int i)

include/openssl/srp.h:96:1: return from a call to sk_SRP_user_pwd_num
  94.   } SRP_user_pwd;
  95.   
  96. > DEFINE_STACK_OF(SRP_user_pwd)
  97.   
  98.   typedef struct SRP_VBASE_st {

crypto/srp/srp_vfy.c:480:17: Loop condition is false. Leaving loop
478.       if (vb == NULL)
479.           return NULL;
480.       for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) {
                       ^
481.           user = sk_SRP_user_pwd_value(vb->users_pwd, i);
482.           if (strcmp(user->id, username) == 0)

crypto/srp/srp_vfy.c:485:10: Taking false branch
483.               return user;
484.       }
485.       if ((vb->seed_key == NULL) ||
                ^
486.           (vb->default_g == NULL) || (vb->default_N == NULL))
487.           return NULL;

crypto/srp/srp_vfy.c:486:10: Taking false branch
484.       }
485.       if ((vb->seed_key == NULL) ||
486.           (vb->default_g == NULL) || (vb->default_N == NULL))
                ^
487.           return NULL;
488.   

crypto/srp/srp_vfy.c:486:37: Taking false branch
484.       }
485.       if ((vb->seed_key == NULL) ||
486.           (vb->default_g == NULL) || (vb->default_N == NULL))
                                           ^
487.           return NULL;
488.   

crypto/srp/srp_vfy.c:491:9: 
489.   /* if the user is unknown we set parameters as well if we have a seed_key */
490.   
491. >     if ((user = SRP_user_pwd_new()) == NULL)
492.           return NULL;
493.   

crypto/srp/srp_vfy.c:198:1: start of procedure SRP_user_pwd_new()
  196.   }
  197.   
  198. > static SRP_user_pwd *SRP_user_pwd_new(void)
  199.   {
  200.       SRP_user_pwd *ret = OPENSSL_malloc(sizeof(*ret));

crypto/srp/srp_vfy.c:200:5: 
  198.   static SRP_user_pwd *SRP_user_pwd_new(void)
  199.   {
  200. >     SRP_user_pwd *ret = OPENSSL_malloc(sizeof(*ret));
  201.       if (ret == NULL)
  202.           return 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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

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

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

crypto/mem.c:138:5: 
    136.       (void)file;
    137.       (void)line;
    138. >     ret = malloc(num);
    139.   #endif
    140.   

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

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

crypto/srp/srp_vfy.c:201:9: Taking false branch
  199.   {
  200.       SRP_user_pwd *ret = OPENSSL_malloc(sizeof(*ret));
  201.       if (ret == NULL)
                 ^
  202.           return NULL;
  203.       ret->N = NULL;

crypto/srp/srp_vfy.c:203:5: 
  201.       if (ret == NULL)
  202.           return NULL;
  203. >     ret->N = NULL;
  204.       ret->g = NULL;
  205.       ret->s = NULL;

crypto/srp/srp_vfy.c:204:5: 
  202.           return NULL;
  203.       ret->N = NULL;
  204. >     ret->g = NULL;
  205.       ret->s = NULL;
  206.       ret->v = NULL;

crypto/srp/srp_vfy.c:205:5: 
  203.       ret->N = NULL;
  204.       ret->g = NULL;
  205. >     ret->s = NULL;
  206.       ret->v = NULL;
  207.       ret->id = NULL;

crypto/srp/srp_vfy.c:206:5: 
  204.       ret->g = NULL;
  205.       ret->s = NULL;
  206. >     ret->v = NULL;
  207.       ret->id = NULL;
  208.       ret->info = NULL;

crypto/srp/srp_vfy.c:207:5: 
  205.       ret->s = NULL;
  206.       ret->v = NULL;
  207. >     ret->id = NULL;
  208.       ret->info = NULL;
  209.       return ret;

crypto/srp/srp_vfy.c:208:5: 
  206.       ret->v = NULL;
  207.       ret->id = NULL;
  208. >     ret->info = NULL;
  209.       return ret;
  210.   }

crypto/srp/srp_vfy.c:209:5: 
  207.       ret->id = NULL;
  208.       ret->info = NULL;
  209. >     return ret;
  210.   }
  211.   

crypto/srp/srp_vfy.c:210:1: return from a call to SRP_user_pwd_new
  208.       ret->info = NULL;
  209.       return ret;
  210. > }
  211.   
  212.   static void SRP_user_pwd_set_gN(SRP_user_pwd *vinfo, const BIGNUM *g,

crypto/srp/srp_vfy.c:491:9: Taking false branch
489.   /* if the user is unknown we set parameters as well if we have a seed_key */
490.   
491.       if ((user = SRP_user_pwd_new()) == NULL)
               ^
492.           return NULL;
493.   

crypto/srp/srp_vfy.c:494:5: 
492.           return NULL;
493.   
494. >     SRP_user_pwd_set_gN(user, vb->default_g, vb->default_N);
495.   
496.       if (!SRP_user_pwd_set_ids(user, username, NULL))

crypto/srp/srp_vfy.c:212:1: start of procedure SRP_user_pwd_set_gN()
  210.   }
  211.   
  212. > static void SRP_user_pwd_set_gN(SRP_user_pwd *vinfo, const BIGNUM *g,
  213.                                   const BIGNUM *N)
  214.   {

crypto/srp/srp_vfy.c:215:5: 
  213.                                   const BIGNUM *N)
  214.   {
  215. >     vinfo->N = N;
  216.       vinfo->g = g;
  217.   }

crypto/srp/srp_vfy.c:216:5: 
  214.   {
  215.       vinfo->N = N;
  216. >     vinfo->g = g;
  217.   }
  218.   

crypto/srp/srp_vfy.c:217:1: return from a call to SRP_user_pwd_set_gN
  215.       vinfo->N = N;
  216.       vinfo->g = g;
  217. > }
  218.   
  219.   static int SRP_user_pwd_set_ids(SRP_user_pwd *vinfo, const char *id,

crypto/srp/srp_vfy.c:496:10: 
494.       SRP_user_pwd_set_gN(user, vb->default_g, vb->default_N);
495.   
496. >     if (!SRP_user_pwd_set_ids(user, username, NULL))
497.           goto err;
498.   

crypto/srp/srp_vfy.c:219:1: start of procedure SRP_user_pwd_set_ids()
  217.   }
  218.   
  219. > static int SRP_user_pwd_set_ids(SRP_user_pwd *vinfo, const char *id,
  220.                                   const char *info)
  221.   {

crypto/srp/srp_vfy.c:222:9: Taking true branch
  220.                                   const char *info)
  221.   {
  222.       if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id)))
                 ^
  223.           return 0;
  224.       return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));

crypto/srp/srp_vfy.c:222:23: 
  220.                                   const char *info)
  221.   {
  222. >     if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id)))
  223.           return 0;
  224.       return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));

crypto/o_str.c:120:1: start of procedure CRYPTO_strdup()
    118.   }
    119.   
    120. > char *CRYPTO_strdup(const char *str, const char* file, int line)
    121.   {
    122.       char *ret;

crypto/o_str.c:125:9: Taking false branch
    123.       size_t size;
    124.   
    125.       if (str == NULL)
                   ^
    126.           return NULL;
    127.       size = strlen(str) + 1;

crypto/o_str.c:127:5: 
    125.       if (str == NULL)
    126.           return NULL;
    127. >     size = strlen(str) + 1;
    128.       ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)

crypto/o_str.c:128:5: 
    126.           return NULL;
    127.       size = strlen(str) + 1;
    128. >     ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)
    130.           memcpy(ret, str, size);

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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

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

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

crypto/mem.c:138:5: 
      136.       (void)file;
      137.       (void)line;
      138. >     ret = malloc(num);
      139.   #endif
      140.   

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

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

crypto/o_str.c:129:9: Taking true branch
    127.       size = strlen(str) + 1;
    128.       ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)
                   ^
    130.           memcpy(ret, str, size);
    131.       return ret;

crypto/o_str.c:130:9: 
    128.       ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)
    130. >         memcpy(ret, str, size);
    131.       return ret;
    132.   }

crypto/o_str.c:131:5: 
    129.       if (ret != NULL)
    130.           memcpy(ret, str, size);
    131. >     return ret;
    132.   }
    133.   

crypto/o_str.c:132:1: return from a call to CRYPTO_strdup
    130.           memcpy(ret, str, size);
    131.       return ret;
    132. > }
    133.   
    134.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/srp/srp_vfy.c:222:23: Taking false branch
  220.                                   const char *info)
  221.   {
  222.       if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id)))
                               ^
  223.           return 0;
  224.       return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));

crypto/srp/srp_vfy.c:224:13: Condition is true
  222.       if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id)))
  223.           return 0;
  224.       return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));
                     ^
  225.   }
  226.   

crypto/srp/srp_vfy.c:224:5: 
  222.       if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id)))
  223.           return 0;
  224. >     return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));
  225.   }
  226.   

crypto/srp/srp_vfy.c:225:1: return from a call to SRP_user_pwd_set_ids
  223.           return 0;
  224.       return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));
  225. > }
  226.   
  227.   static int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s,

crypto/srp/srp_vfy.c:496:10: Taking false branch
494.       SRP_user_pwd_set_gN(user, vb->default_g, vb->default_N);
495.   
496.       if (!SRP_user_pwd_set_ids(user, username, NULL))
                ^
497.           goto err;
498.   

crypto/srp/srp_vfy.c:499:9: 
497.           goto err;
498.   
499. >     if (RAND_bytes(digv, SHA_DIGEST_LENGTH) <= 0)
500.           goto err;
501.       ctxt = EVP_MD_CTX_new();

crypto/rand/rand_lib.c:154:1: start of procedure RAND_bytes()
  152.   }
  153.   
  154. > int RAND_bytes(unsigned char *buf, int num)
  155.   {
  156.       const RAND_METHOD *meth = RAND_get_rand_method();

crypto/rand/rand_lib.c:156:5: 
  154.   int RAND_bytes(unsigned char *buf, int num)
  155.   {
  156. >     const RAND_METHOD *meth = RAND_get_rand_method();
  157.       if (meth && meth->bytes)
  158.           return meth->bytes(buf, num);

crypto/rand/rand_lib.c:91:1: start of procedure RAND_get_rand_method()
    89.   }
    90.   
    91. > const RAND_METHOD *RAND_get_rand_method(void)
    92.   {
    93.       if (!default_RAND_meth) {

crypto/rand/rand_lib.c:93:10: Taking false branch
    91.   const RAND_METHOD *RAND_get_rand_method(void)
    92.   {
    93.       if (!default_RAND_meth) {
                   ^
    94.   #ifndef OPENSSL_NO_ENGINE
    95.           ENGINE *e = ENGINE_get_default_RAND();

crypto/rand/rand_lib.c:109:5: 
    107.               default_RAND_meth = RAND_OpenSSL();
    108.       }
    109. >     return default_RAND_meth;
    110.   }
    111.   

crypto/rand/rand_lib.c:110:1: return from a call to RAND_get_rand_method
    108.       }
    109.       return default_RAND_meth;
    110. > }
    111.   
    112.   #ifndef OPENSSL_NO_ENGINE

crypto/rand/rand_lib.c:157:9: Taking true branch
  155.   {
  156.       const RAND_METHOD *meth = RAND_get_rand_method();
  157.       if (meth && meth->bytes)
                 ^
  158.           return meth->bytes(buf, num);
  159.       return (-1);

crypto/rand/rand_lib.c:157:17: Taking false branch
  155.   {
  156.       const RAND_METHOD *meth = RAND_get_rand_method();
  157.       if (meth && meth->bytes)
                         ^
  158.           return meth->bytes(buf, num);
  159.       return (-1);

crypto/rand/rand_lib.c:159:5: 
  157.       if (meth && meth->bytes)
  158.           return meth->bytes(buf, num);
  159. >     return (-1);
  160.   }
  161.   

crypto/rand/rand_lib.c:160:1: return from a call to RAND_bytes
  158.           return meth->bytes(buf, num);
  159.       return (-1);
  160. > }
  161.   
  162.   #if OPENSSL_API_COMPAT < 0x10100000L

crypto/srp/srp_vfy.c:499:9: Taking true branch
497.           goto err;
498.   
499.       if (RAND_bytes(digv, SHA_DIGEST_LENGTH) <= 0)
               ^
500.           goto err;
501.       ctxt = EVP_MD_CTX_new();

crypto/srp/srp_vfy.c:513:2: 
511.           return user;
512.   
513. >  err:
514.       EVP_MD_CTX_free(ctxt);
515.       SRP_user_pwd_free(user);

crypto/srp/srp_vfy.c:514:5: 
512.   
513.    err:
514. >     EVP_MD_CTX_free(ctxt);
515.       SRP_user_pwd_free(user);
516.       return NULL;

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:233:1: start of procedure CRYPTO_free()
    231.   }
    232.   
    233. > void CRYPTO_free(void *str)
    234.   {
    235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
    242.       }
    243.   #else
    244. >     free(str);
    245.   #endif
    246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
    244.       free(str);
    245.   #endif
    246. > }
    247.   
    248.   void CRYPTO_clear_free(void *str, size_t num)

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)

crypto/srp/srp_vfy.c:515:5: Skipping SRP_user_pwd_free(): empty list of specs
513.    err:
514.       EVP_MD_CTX_free(ctxt);
515.       SRP_user_pwd_free(user);
           ^
516.       return NULL;
517.   }

SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)
{
    int i;
    SRP_user_pwd *user;
    unsigned char digv[SHA_DIGEST_LENGTH];
    unsigned char digs[SHA_DIGEST_LENGTH];
    EVP_MD_CTX *ctxt = NULL;
    if (vb == NULL)
        return NULL;
    for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) {
        user = sk_SRP_user_pwd_value(vb->users_pwd, i);
        if (strcmp(user->id, username) == 0)
            return user;
    }
    if ((vb->seed_key == NULL) ||
        (vb->default_g == NULL) || (vb->default_N == NULL))
        return NULL;
    if ((user = SRP_user_pwd_new()) == NULL)
        return NULL;
    SRP_user_pwd_set_gN(user, vb->default_g, vb->default_N);
    if (!SRP_user_pwd_set_ids(user, username, NULL))
        goto err;
    if (RAND_bytes(digv, SHA_DIGEST_LENGTH) <= 0)
        goto err;
    ctxt = EVP_MD_CTX_new();
    EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL);
    EVP_DigestUpdate(ctxt, vb->seed_key, strlen(vb->seed_key));
    EVP_DigestUpdate(ctxt, username, strlen(username));
    EVP_DigestFinal_ex(ctxt, digs, NULL);
    EVP_MD_CTX_free(ctxt);
    ctxt = NULL;
    if (SRP_user_pwd_set_sv_BN(user,
                               BN_bin2bn(digs, SHA_DIGEST_LENGTH, NULL),
                               BN_bin2bn(digv, SHA_DIGEST_LENGTH, NULL)))
        return user;
 err:
    EVP_MD_CTX_free(ctxt);
    SRP_user_pwd_free(user);
    return NULL;
}
['SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)\n{\n    int i;\n    SRP_user_pwd *user;\n    unsigned char digv[SHA_DIGEST_LENGTH];\n    unsigned char digs[SHA_DIGEST_LENGTH];\n    EVP_MD_CTX *ctxt = NULL;\n    if (vb == NULL)\n        return NULL;\n    for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) {\n        user = sk_SRP_user_pwd_value(vb->users_pwd, i);\n        if (strcmp(user->id, username) == 0)\n            return user;\n    }\n    if ((vb->seed_key == NULL) ||\n        (vb->default_g == NULL) || (vb->default_N == NULL))\n        return NULL;\n    if ((user = SRP_user_pwd_new()) == NULL)\n        return NULL;\n    SRP_user_pwd_set_gN(user, vb->default_g, vb->default_N);\n    if (!SRP_user_pwd_set_ids(user, username, NULL))\n        goto err;\n    if (RAND_bytes(digv, SHA_DIGEST_LENGTH) <= 0)\n        goto err;\n    ctxt = EVP_MD_CTX_new();\n    EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL);\n    EVP_DigestUpdate(ctxt, vb->seed_key, strlen(vb->seed_key));\n    EVP_DigestUpdate(ctxt, username, strlen(username));\n    EVP_DigestFinal_ex(ctxt, digs, NULL);\n    EVP_MD_CTX_free(ctxt);\n    ctxt = NULL;\n    if (SRP_user_pwd_set_sv_BN(user,\n                               BN_bin2bn(digs, SHA_DIGEST_LENGTH, NULL),\n                               BN_bin2bn(digv, SHA_DIGEST_LENGTH, NULL)))\n        return user;\n err:\n    EVP_MD_CTX_free(ctxt);\n    SRP_user_pwd_free(user);\n    return NULL;\n}', 'DEFINE_STACK_OF(SRP_user_pwd)', 'int sk_num(const _STACK *st)\n{\n    if (st == NULL)\n        return -1;\n    return st->num;\n}', 'static SRP_user_pwd *SRP_user_pwd_new(void)\n{\n    SRP_user_pwd *ret = OPENSSL_malloc(sizeof(*ret));\n    if (ret == NULL)\n        return NULL;\n    ret->N = NULL;\n    ret->g = NULL;\n    ret->s = NULL;\n    ret->v = NULL;\n    ret->id = NULL;\n    ret->info = NULL;\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\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    (void)file;\n    (void)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}', 'static void SRP_user_pwd_set_gN(SRP_user_pwd *vinfo, const BIGNUM *g,\n                                const BIGNUM *N)\n{\n    vinfo->N = N;\n    vinfo->g = g;\n}', 'static int SRP_user_pwd_set_ids(SRP_user_pwd *vinfo, const char *id,\n                                const char *info)\n{\n    if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id)))\n        return 0;\n    return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info)));\n}', 'char *CRYPTO_strdup(const char *str, const char* file, int line)\n{\n    char *ret;\n    size_t size;\n    if (str == NULL)\n        return NULL;\n    size = strlen(str) + 1;\n    ret = CRYPTO_malloc(size, file, line);\n    if (ret != NULL)\n        memcpy(ret, str, size);\n    return ret;\n}', 'int RAND_bytes(unsigned char *buf, int num)\n{\n    const RAND_METHOD *meth = RAND_get_rand_method();\n    if (meth && meth->bytes)\n        return meth->bytes(buf, num);\n    return (-1);\n}', 'const RAND_METHOD *RAND_get_rand_method(void)\n{\n    if (!default_RAND_meth) {\n#ifndef OPENSSL_NO_ENGINE\n        ENGINE *e = ENGINE_get_default_RAND();\n        if (e) {\n            default_RAND_meth = ENGINE_get_RAND(e);\n            if (!default_RAND_meth) {\n                ENGINE_finish(e);\n                e = NULL;\n            }\n        }\n        if (e)\n            funct_ref = e;\n        else\n#endif\n            default_RAND_meth = RAND_OpenSSL();\n    }\n    return default_RAND_meth;\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)\n{\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']