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


crypto/evp/pmeth_gn.c:135:1: start of procedure EVP_PKEY_keygen()
133.   }
134.   
135. > int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
136.   {
137.       int ret;

crypto/evp/pmeth_gn.c:139:10: Taking false branch
137.       int ret;
138.   
139.       if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) {
                ^
140.           EVPerr(EVP_F_EVP_PKEY_KEYGEN,
141.                  EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);

crypto/evp/pmeth_gn.c:139:18: Taking false branch
137.       int ret;
138.   
139.       if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) {
                        ^
140.           EVPerr(EVP_F_EVP_PKEY_KEYGEN,
141.                  EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);

crypto/evp/pmeth_gn.c:139:33: Taking false branch
137.       int ret;
138.   
139.       if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) {
                                       ^
140.           EVPerr(EVP_F_EVP_PKEY_KEYGEN,
141.                  EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);

crypto/evp/pmeth_gn.c:144:9: Taking false branch
142.           return -2;
143.       }
144.       if (ctx->operation != EVP_PKEY_OP_KEYGEN) {
               ^
145.           EVPerr(EVP_F_EVP_PKEY_KEYGEN, EVP_R_OPERATON_NOT_INITIALIZED);
146.           return -1;

crypto/evp/pmeth_gn.c:149:9: Taking false branch
147.       }
148.   
149.       if (ppkey == NULL)
               ^
150.           return -1;
151.   

crypto/evp/pmeth_gn.c:152:9: Taking true branch
150.           return -1;
151.   
152.       if (*ppkey == NULL)
               ^
153.           *ppkey = EVP_PKEY_new();
154.       if (*ppkey == NULL)

crypto/evp/pmeth_gn.c:153:9: 
151.   
152.       if (*ppkey == NULL)
153. >         *ppkey = EVP_PKEY_new();
154.       if (*ppkey == NULL)
155.           return -1;

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:154:9: Taking false branch
152.       if (*ppkey == NULL)
153.           *ppkey = EVP_PKEY_new();
154.       if (*ppkey == NULL)
               ^
155.           return -1;
156.   

crypto/evp/pmeth_gn.c:157:5: Skipping __function_pointer__(): unresolved function pointer
155.           return -1;
156.   
157.       ret = ctx->pmeth->keygen(ctx, *ppkey);
           ^
158.       if (ret <= 0) {
159.           EVP_PKEY_free(*ppkey);

crypto/evp/pmeth_gn.c:158:9: Taking true branch
156.   
157.       ret = ctx->pmeth->keygen(ctx, *ppkey);
158.       if (ret <= 0) {
               ^
159.           EVP_PKEY_free(*ppkey);
160.           *ppkey = NULL;

crypto/evp/pmeth_gn.c:159:9: 
157.       ret = ctx->pmeth->keygen(ctx, *ppkey);
158.       if (ret <= 0) {
159. >         EVP_PKEY_free(*ppkey);
160.           *ppkey = NULL;
161.       }

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:160:9: 
158.       if (ret <= 0) {
159.           EVP_PKEY_free(*ppkey);
160. >         *ppkey = NULL;
161.       }
162.       return ret;
