DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, feifei.wang2@arm.com,
	nd@arm.com, Ruifeng Wang <ruifeng.wang@arm.com>,
	stable@dpdk.org
Subject: [PATCH 3/4] test/malloc: fix missing free
Date: Fri, 19 May 2023 12:29:22 +0800	[thread overview]
Message-ID: <20230519042923.314670-4-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20230519042923.314670-1-ruifeng.wang@arm.com>

Free the allocated buffer before returning.

Fixes: a40a1f8231b4 ("app: various tests update")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
---
 app/test/test_malloc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index de40e50611..f144b89d88 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -937,6 +937,7 @@ test_alloc_single_socket(int32_t socket)
 	if (mem == NULL)
 		return -1;
 	if (addr_to_socket(mem) != desired_socket) {
+		rte_free(mem);
 		return -1;
 	}
 	rte_free(mem);
-- 
2.25.1


  parent reply	other threads:[~2023-05-19  4:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  4:29 [PATCH 0/4] Heap library and test case changes Ruifeng Wang
2023-05-19  4:29 ` [PATCH 1/4] eal: fix list index for 256 byte element Ruifeng Wang
2023-05-19 11:10   ` Burakov, Anatoly
2023-05-19  4:29 ` [PATCH 2/4] eal: simplify check condition Ruifeng Wang
2023-05-19 11:06   ` Burakov, Anatoly
2023-05-19  4:29 ` Ruifeng Wang [this message]
2023-05-19 11:08   ` [PATCH 3/4] test/malloc: fix missing free Burakov, Anatoly
2023-05-19  4:29 ` [PATCH 4/4] test/malloc: fix case expectation Ruifeng Wang
2023-05-19 11:07   ` Burakov, Anatoly
2023-06-05 16:06 ` [PATCH 0/4] Heap library and test case changes Thomas Monjalon

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=20230519042923.314670-4-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=feifei.wang2@arm.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=nd@arm.com \
    --cc=stable@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).