All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Cc: <dev@dpdk.org>, <anoobj@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>, Kai Ji <kai.ji@intel.com>,
	Ciara Power <ciara.power@intel.com>
Subject: Re: [PATCH v2] crypto/openssl: fix memory leaks in asym ops
Date: Thu, 2 Nov 2023 15:47:18 -0700	[thread overview]
Message-ID: <20231102154718.74272c0d@fedora> (raw)
In-Reply-To: <83522013646bcd96b2420b3f69b74255981b3a20.1698913776.git.gmuthukrishn@marvell.com>

On Thu, 2 Nov 2023 14:08:31 +0530
Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com> wrote:

> +	if (pub_key)
> +		BN_free(pub_key);
> +	if (pkey)
> +		EVP_PKEY_free(pkey);
>  

All these checks for null are unnecessary:

       EVP_PKEY_free() decrements the reference count of key and, if the reference count is zero,
       frees it up. If key is NULL, nothing is done.


Let me add those functions to cocci nullfree script as well.


  reply	other threads:[~2023-11-02 22:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19 13:04 [PATCH] crypto/openssl: fix memory leaks in SM2 ops Gowrishankar Muthukrishnan
2023-10-23 13:33 ` Akhil Goyal
2023-11-02  8:38 ` [PATCH v2] crypto/openssl: fix memory leaks in asym ops Gowrishankar Muthukrishnan
2023-11-02 10:03   ` Gowrishankar Muthukrishnan
2023-11-02 22:47   ` Stephen Hemminger [this message]
2023-11-03 15:19     ` [EXT] " Gowrishankar Muthukrishnan
2023-11-03 10:18   ` Power, Ciara
2023-11-03 11:38   ` Power, Ciara
2023-11-03 15:15   ` [PATCH v3] " Gowrishankar Muthukrishnan
2023-11-03 15:39     ` Power, Ciara
2023-11-09 20:18     ` Akhil Goyal
2023-11-13  5:41     ` [PATCH v4] " Gowrishankar Muthukrishnan
2023-11-13  6:23       ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231102154718.74272c0d@fedora \
    --to=stephen@networkplumber.org \
    --cc=anoobj@marvell.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=gmuthukrishn@marvell.com \
    --cc=kai.ji@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.