[PATCH] rest.c: plug a leak
Jeff Darcy
jdarcy at redhat.com
Mon Sep 27 14:17:28 UTC 2010
On 09/27/2010 10:12 AM, Jim Meyering wrote:
> Running the sole test under valgrind showed one "definite" leak.
> Here's a fix:
Ack also (too late I know). Nice catch.
>
>>From 7d22e8e762844a2df42916bc5aa187cbc79c768a Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Mon, 27 Sep 2010 16:12:27 +0200
> Subject: [PATCH] rest.c: plug a leak
>
> * rest.c (proxy_create_bucket): Free "ms" here, too, so as not to
> leak the state buffer allocated and dispatched in access_handler.
>
> 496 bytes in 1 blocks are definitely lost in loss record 270 of 288
> at 0x4A0515D: malloc (vg_replace_malloc.c:195)
> by 0x42700C: access_handler (rest.c:1603)
> by 0x4E3BB38: ??? (in /usr/lib64/libmicrohttpd.so.5.2.1)
> by 0x4E3D087: ??? (in /usr/lib64/libmicrohttpd.so.5.2.1)
> by 0x4E3F9F9: ??? (in /usr/lib64/libmicrohttpd.so.5.2.1)
> by 0x31BB407760: start_thread (pthread_create.c:301)
> by 0x31BA8E151C: clone (clone.S:115)
> ---
> rest.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/rest.c b/rest.c
> index 498c8da..4e784fc 100644
> --- a/rest.c
> +++ b/rest.c
> @@ -1503,6 +1503,7 @@ proxy_create_bucket (void *cctx, struct MHD_Connection *conn, const char *url,
> MHD_queue_response(conn,rc,resp);
> MHD_destroy_response(resp);
>
> + free_ms(ms);
> return MHD_YES;
> }
>
> --
> 1.7.3.264.g8bb1
> _______________________________________________
> iwhd-devel mailing list
> iwhd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/iwhd-devel
More information about the iwhd-devel
mailing list