X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Fevent.c;h=5785345cd1bdb703da157f428da38733aefc582f;hp=046028cd219a46b25866770c1d8c96b8405092a2;hb=1ebc45cd4c1b34fbaacb8b8403fbb5d3fab33d3f;hpb=abcc74facc86124042abdb9fd4391b6eadda2b9e diff --git a/src/lib/lttng-ctl/event.c b/src/lib/lttng-ctl/event.c index 046028cd2..5785345cd 100644 --- a/src/lib/lttng-ctl/event.c +++ b/src/lib/lttng-ctl/event.c @@ -60,7 +60,7 @@ struct lttng_event *lttng_event_copy(const struct lttng_event *event) struct lttng_event_extended *new_event_extended; new_event = zmalloc(sizeof(*event)); - if (!event) { + if (!new_event) { PERROR("Error allocating event structure"); goto end; } @@ -82,7 +82,7 @@ struct lttng_event *lttng_event_copy(const struct lttng_event *event) end: return new_event; error: - free(event); + free(new_event); goto end; } @@ -197,8 +197,8 @@ end: return ret; } -struct lttng_userspace_probe_location * -lttng_event_get_userspace_probe_location(struct lttng_event *event) +const struct lttng_userspace_probe_location * +lttng_event_get_userspace_probe_location(const struct lttng_event *event) { struct lttng_userspace_probe_location *probe_location = NULL; struct lttng_event_extended *event_extended;