crypto/evp/pmeth_gn.c:113: error: MEMORY_LEAK
  memory dynamically allocated to `*ppkey` by call to `EVP_PKEY_new()` at line 103, column 18 is not reachable after line 113, column 9.
Showing all 60 steps of the trace


crypto/evp/pmeth_gn.c:85:1: start of procedure EVP_PKEY_paramgen()
83.   }
84.   
85. > int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
86.   {
87.       int ret;

crypto/evp/pmeth_gn.c:88:10: Taking false branch
86.   {
87.       int ret;
88.       if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) {
               ^
89.           EVPerr(EVP_F_EVP_PKEY_PARAMGEN,
90.                  EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);

crypto/evp/pmeth_gn.c:88:18: Taking false branch
86.   {
87.       int ret;
88.       if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) {
                       ^
89.           EVPerr(EVP_F_EVP_PKEY_PARAMGEN,
90.                  EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);

crypto/evp/pmeth_gn.c:88:33: Taking false branch
86.   {
87.       int ret;
88.       if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) {
                                      ^
89.           EVPerr(EVP_F_EVP_PKEY_PARAMGEN,
90.                  EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);

crypto/evp/pmeth_gn.c:94:9: Taking false branch
92.       }
93.   
94.       if (ctx->operation != EVP_PKEY_OP_PARAMGEN) {
              ^
95.           EVPerr(EVP_F_EVP_PKEY_PARAMGEN, EVP_R_OPERATON_NOT_INITIALIZED);
96.           return -1;

crypto/evp/pmeth_gn.c:99:9: Taking false branch
97.       }
98.   
99.       if (ppkey == NULL)
               ^
100.           return -1;
101.   

crypto/evp/pmeth_gn.c:102:9: Taking true branch
100.           return -1;
101.   
102.       if (*ppkey == NULL)
               ^
103.           *ppkey = EVP_PKEY_new();
104.   

crypto/evp/pmeth_gn.c:103:9: 
101.   
102.       if (*ppkey == NULL)
103. >         *ppkey = EVP_PKEY_new();
104.   
105.       if (*ppkey == NULL) {

crypto/evp/p_lib.c:187:1: start of procedure EVP_PKEY_new()
  185.   }
  186.   
  187. > EVP_PKEY *EVP_PKEY_new(void)
  188.   {
  189.       EVP_PKEY *ret;

crypto/evp/p_lib.c:191:5: 
  189.       EVP_PKEY *ret;
  190.   
  191. >     ret = OPENSSL_malloc(sizeof(*ret));
  192.       if (ret == NULL) {
  193.           EVPerr(EVP_F_EVP_PKEY_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

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

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

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

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

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

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

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

crypto/evp/p_lib.c:192:9: Taking false branch
  190.   
  191.       ret = OPENSSL_malloc(sizeof(*ret));
  192.       if (ret == NULL) {
                 ^
  193.           EVPerr(EVP_F_EVP_PKEY_NEW, ERR_R_MALLOC_FAILURE);
  194.           return (NULL);

crypto/evp/p_lib.c:196:5: 
  194.           return (NULL);
  195.       }
  196. >     ret->type = EVP_PKEY_NONE;
  197.       ret->save_type = EVP_PKEY_NONE;
  198.       ret->references = 1;

crypto/evp/p_lib.c:197:5: 
  195.       }
  196.       ret->type = EVP_PKEY_NONE;
  197. >     ret->save_type = EVP_PKEY_NONE;
  198.       ret->references = 1;
  199.       ret->ameth = NULL;

crypto/evp/p_lib.c:198:5: 
  196.       ret->type = EVP_PKEY_NONE;
  197.       ret->save_type = EVP_PKEY_NONE;
  198. >     ret->references = 1;
  199.       ret->ameth = NULL;
  200.       ret->engine = NULL;

crypto/evp/p_lib.c:199:5: 
  197.       ret->save_type = EVP_PKEY_NONE;
  198.       ret->references = 1;
  199. >     ret->ameth = NULL;
  200.       ret->engine = NULL;
  201.       ret->pkey.ptr = NULL;

crypto/evp/p_lib.c:200:5: 
  198.       ret->references = 1;
  199.       ret->ameth = NULL;
  200. >     ret->engine = NULL;
  201.       ret->pkey.ptr = NULL;
  202.       ret->attributes = NULL;

crypto/evp/p_lib.c:201:5: 
  199.       ret->ameth = NULL;
  200.       ret->engine = NULL;
  201. >     ret->pkey.ptr = NULL;
  202.       ret->attributes = NULL;
  203.       ret->save_parameters = 1;

crypto/evp/p_lib.c:202:5: 
  200.       ret->engine = NULL;
  201.       ret->pkey.ptr = NULL;
  202. >     ret->attributes = NULL;
  203.       ret->save_parameters = 1;
  204.       return (ret);

crypto/evp/p_lib.c:203:5: 
  201.       ret->pkey.ptr = NULL;
  202.       ret->attributes = NULL;
  203. >     ret->save_parameters = 1;
  204.       return (ret);
  205.   }

crypto/evp/p_lib.c:204:5: 
  202.       ret->attributes = NULL;
  203.       ret->save_parameters = 1;
  204. >     return (ret);
  205.   }
  206.   

crypto/evp/p_lib.c:205:1: return from a call to EVP_PKEY_new
  203.       ret->save_parameters = 1;
  204.       return (ret);
  205. > }
  206.   
  207.   void EVP_PKEY_up_ref(EVP_PKEY *pkey)

crypto/evp/pmeth_gn.c:105:9: Taking false branch
103.           *ppkey = EVP_PKEY_new();
104.   
105.       if (*ppkey == NULL) {
               ^
106.           EVPerr(EVP_F_EVP_PKEY_PARAMGEN, ERR_R_MALLOC_FAILURE);
107.           return -1;

crypto/evp/pmeth_gn.c:110:5: Skipping __function_pointer__(): unresolved function pointer
108.       }
109.   
110.       ret = ctx->pmeth->paramgen(ctx, *ppkey);
           ^
111.       if (ret <= 0) {
112.           EVP_PKEY_free(*ppkey);

crypto/evp/pmeth_gn.c:111:9: Taking true branch
109.   
110.       ret = ctx->pmeth->paramgen(ctx, *ppkey);
111.       if (ret <= 0) {
               ^
112.           EVP_PKEY_free(*ppkey);
113.           *ppkey = NULL;

crypto/evp/pmeth_gn.c:112:9: 
110.       ret = ctx->pmeth->paramgen(ctx, *ppkey);
111.       if (ret <= 0) {
112. >         EVP_PKEY_free(*ppkey);
113.           *ppkey = NULL;
114.       }

crypto/evp/p_lib.c:420:1: start of procedure EVP_PKEY_free()
  418.   }
  419.   
  420. > void EVP_PKEY_free(EVP_PKEY *x)
  421.   {
  422.       int i;

crypto/evp/p_lib.c:424:9: Taking false branch
  422.       int i;
  423.   
  424.       if (x == NULL)
                 ^
  425.           return;
  426.   

crypto/evp/p_lib.c:427:5: 
  425.           return;
  426.   
  427. >     i = CRYPTO_add(&x->references, -1, CRYPTO_LOCK_EVP_PKEY);
  428.   #ifdef REF_PRINT
  429.       REF_PRINT("EVP_PKEY", x);

crypto/lock.c:456:1: start of procedure CRYPTO_add_lock()
    454.   }
    455.   
    456. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
    457.                       int line)
    458.   {

crypto/lock.c:459:5: 
    457.                       int line)
    458.   {
    459. >     int ret = 0;
    460.   
    461.       if (add_lock_callback != NULL) {

crypto/lock.c:461:9: Taking false branch
    459.       int ret = 0;
    460.   
    461.       if (add_lock_callback != NULL) {
                   ^
    462.   #ifdef LOCK_DEBUG
    463.           int before = *pointer;

crypto/lock.c:477:9: 
    475.   #endif
    476.       } else {
    477. >         CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
    478.   
    479.           ret = *pointer + amount;

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/lock.c:479:9: 
    477.           CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
    478.   
    479. >         ret = *pointer + amount;
    480.   #ifdef LOCK_DEBUG
    481.           {

crypto/lock.c:490:9: 
    488.           }
    489.   #endif
    490. >         *pointer = ret;
    491.           CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
    492.       }

crypto/lock.c:491:9: 
    489.   #endif
    490.           *pointer = ret;
    491. >         CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
    492.       }
    493.       return (ret);

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/lock.c:493:5: 
    491.           CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
    492.       }
    493. >     return (ret);
    494.   }
    495.   

crypto/lock.c:494:1: return from a call to CRYPTO_add_lock
    492.       }
    493.       return (ret);
    494. > }
    495.   
    496.   const char *CRYPTO_get_lock_name(int type)

crypto/evp/p_lib.c:431:9: Taking true branch
  429.       REF_PRINT("EVP_PKEY", x);
  430.   #endif
  431.       if (i > 0)
                 ^
  432.           return;
  433.   #ifdef REF_CHECK

crypto/evp/p_lib.c:432:9: 
  430.   #endif
  431.       if (i > 0)
  432. >         return;
  433.   #ifdef REF_CHECK
  434.       if (i < 0) {

crypto/evp/p_lib.c:442:1: return from a call to EVP_PKEY_free
  440.       sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  441.       OPENSSL_free(x);
  442. > }
  443.   
  444.   static void EVP_PKEY_free_it(EVP_PKEY *x)

crypto/evp/pmeth_gn.c:113:9: 
111.       if (ret <= 0) {
112.           EVP_PKEY_free(*ppkey);
113. >         *ppkey = NULL;
114.       }
115.       return ret;
