All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch 2/2] chunkd: fix up the leak in cld_begin
@ 2009-08-05  7:31 Pete Zaitcev
  0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2009-08-05  7:31 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Project Hail List

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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-05  7:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05  7:31 [Patch 2/2] chunkd: fix up the leak in cld_begin Pete Zaitcev

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.