From: Alecs King <alecsk@gmail.com>
To: linux-sparse <linux-sparse@vger.kernel.org>
Subject: [PATCH] fix a memory leak in pack_ptr_list
Date: Sat, 31 Dec 2005 15:20:27 +0800 [thread overview]
Message-ID: <20051231072027.GA1619@localhost> (raw)
Free the last entry when the whole list gets empty.
Signed-off-by: Alecs King <alecsk@gmail.com>
diff --git a/ptrlist.c b/ptrlist.c
index 14d8416..467a108 100644
--- a/ptrlist.c
+++ b/ptrlist.c
@@ -72,6 +72,7 @@ restart:
if (!entry->nr) {
struct ptr_list *prev;
if (next == entry) {
+ free(entry);
*listp = NULL;
return;
}
--
Alecs King
reply other threads:[~2005-12-31 7:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20051231072027.GA1619@localhost \
--to=alecsk@gmail.com \
--cc=linux-sparse@vger.kernel.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