From: Mathieu Desnoyers Date: Mon, 10 Dec 2012 20:33:05 +0000 (-0500) Subject: fix memleak: ustctl free shadow chan on ustctl_unmap_channel() X-Git-Tag: v2.1.0~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9b73319850771018e666a2832debea5471afcd51;p=lttng-ust.git fix memleak: ustctl free shadow chan on ustctl_unmap_channel() Also on error path within map channel. Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 7a76b7dd..059a258f 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -685,6 +685,7 @@ struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *ch default: ERR("Unknown client type %d", config->client_type); channel_destroy(chan, handle, 1); + free(handle->shadow_chan); return NULL; } /* Replace the object table pointer. */ @@ -735,6 +736,7 @@ void ustctl_unmap_channel(struct lttng_ust_shm_handle *handle) assert(handle); chan = shmp(handle, handle->chan); channel_destroy(chan, handle, 1); + free(handle->shadow_chan); } /*