X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-abi.c;fp=liblttng-ust%2Flttng-ust-abi.c;h=daf0d5e4caa0185652605e9a0496c2ad0fb2f0b3;hb=24e6ac9b18904de64d31dc79f53b1c8296541c8a;hp=2de4df1aeee9a3e0dd992e2843681cff070e0c9f;hpb=01a9d8837a56844c01bc1f97a7daedd7902efc2e;p=deliverable%2Flttng-ust.git diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index 2de4df1a..daf0d5e4 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -438,6 +438,10 @@ int lttng_abi_map_channel(int session_objd, goto handle_error; } + /* Ownership of chan_data and wakeup_fd taken by channel handle. */ + uargs->channel.chan_data = NULL; + uargs->channel.wakeup_fd = -1; + chan = shmp(channel_handle, channel_handle->chan); assert(chan); chan->handle = channel_handle; @@ -521,24 +525,9 @@ alloc_error: channel_destroy(chan, channel_handle, 0); return ret; - /* - * error path before channel creation (owning chan_data and - * wakeup_fd). - */ handle_error: active: invalid: - { - int close_ret; - - lttng_ust_lock_fd_tracker(); - close_ret = close(wakeup_fd); - lttng_ust_unlock_fd_tracker(); - if (close_ret) { - PERROR("close"); - } - } - free(chan_data); return ret; }