From: Andre Noll Date: Fri, 15 Jan 2010 19:21:57 +0000 (+0100) Subject: client: Fix a memory leak in client_post_select(). X-Git-Tag: v0.4.2~87 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=11ef83c4abb2ccbdf3f99a8adf98749b2b0656c2 client: Fix a memory leak in client_post_select(). --- 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);