From: Pete Zaitcev <zaitcev@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch 2/2] chunkd: fix up the leak in cld_begin
Date: Wed, 5 Aug 2009 01:31:38 -0600 [thread overview]
Message-ID: <20090805013138.0119549b@redhat.com> (raw)
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
diff --git a/server/cldu.c b/server/cldu.c
index 34dd996..172c5cc 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -534,16 +534,16 @@ int cld_begin(const char *thishost, const char *thiscell, uint32_t nid,
*/
i = 0;
for (tmp = host_list; tmp; tmp = tmp->next) {
+ struct cldc_host *hp = tmp->data;
if (i < N_CLD) {
- memcpy(&ses.cldv[i].h, tmp->data,
+ memcpy(&ses.cldv[i].h, hp,
sizeof(struct cldc_host));
ses.cldv[i].known = 1;
i++;
} else {
- struct cldc_host *hp = tmp->data;
free(hp->host);
- free(hp);
}
+ free(hp);
}
g_list_free(host_list);
reply other threads:[~2009-08-05 7:31 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=20090805013138.0119549b@redhat.com \
--to=zaitcev@redhat.com \
--cc=hail-devel@vger.kernel.org \
--cc=jeff@garzik.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 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.