From 11ef83c4abb2ccbdf3f99a8adf98749b2b0656c2 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 15 Jan 2010 20:21:57 +0100 Subject: [PATCH] client: Fix a memory leak in client_post_select(). --- client_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client_common.c b/client_common.c index 2a93d488..bd5a7bfb 100644 --- a/client_common.c +++ b/client_common.c @@ -278,7 +278,6 @@ static void client_post_select(struct sched *s, struct task *t) case CL_RECEIVING: { char *buf2; - buf2 = para_malloc(CLIENT_BUFSIZE); ret = btr_node_status(btrn, 0, BTR_NT_ROOT); if (ret < 0) goto err; @@ -286,6 +285,7 @@ static void client_post_select(struct sched *s, struct task *t) return; if (!FD_ISSET(ct->rc4c.fd, &s->rfds)) return; + buf2 = para_malloc(CLIENT_BUFSIZE); ret = client_recv_buffer(ct, buf2, CLIENT_BUFSIZE); if (ret < 0) { free(buf2); -- 2.39.5