]> git.lttng.org Git - lttng-ust.git/commitdiff
fix memleak: ustctl free shadow chan on ustctl_unmap_channel()
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 10 Dec 2012 20:33:05 +0000 (15:33 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 10 Dec 2012 20:33:05 +0000 (15:33 -0500)
Also on error path within map channel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-ctl/ustctl.c

index 7a76b7dda32841c186e8cef862e0a4689e3c6a2f..059a258fbcb4a50c1b951d1977a2d961872fbcce 100644 (file)
@@ -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);
 }
 
 /*
This page took 0.030002 seconds and 4 git commands to generate.