Fix: remove invalid free
[lttng-ust.git] / liblttng-ust / lttng-ust-abi.c
index 7e513a98d09393c4d379e791406d3c151ee1df10..9e4e5cd56713eb77659b72aa074140c6c51bfa4b 100644 (file)
@@ -335,9 +335,10 @@ long lttng_abi_tracer_version(int objd,
 static
 long lttng_abi_add_context(int objd,
        struct lttng_ust_context *context_param,
+       union ust_args *uargs,
        struct lttng_ctx **ctx, struct lttng_session *session)
 {
-       return lttng_attach_context(context_param, ctx, session);
+       return lttng_attach_context(context_param, uargs, ctx, session);
 }
 
 /**
@@ -467,8 +468,6 @@ int lttng_abi_map_channel(int session_objd,
                chan_name = "channel";
                break;
        default:
-               transport_name = "<unknown>";
-               chan_name = "<unknown>";
                ret = -EINVAL;
                goto notransport;
        }
@@ -514,7 +513,6 @@ int lttng_abi_map_channel(int session_objd,
        /* error path after channel was created */
 objd_error:
 notransport:
-       free(lttng_chan);
 alloc_error:
        channel_destroy(chan, channel_handle, 0);
        return ret;
@@ -574,6 +572,8 @@ long lttng_session_cmd(int objd, unsigned int cmd, unsigned long arg,
        case LTTNG_UST_SESSION_STOP:
        case LTTNG_UST_DISABLE:
                return lttng_session_disable(session);
+       case LTTNG_UST_SESSION_STATEDUMP:
+               return lttng_session_statedump(session);
        default:
                return -EINVAL;
        }
@@ -887,7 +887,7 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg,
        }
        case LTTNG_UST_CONTEXT:
                return lttng_abi_add_context(objd,
-                               (struct lttng_ust_context *) arg,
+                               (struct lttng_ust_context *) arg, uargs,
                                &channel->ctx, channel->session);
        case LTTNG_UST_ENABLE:
                return lttng_channel_enable(channel);
@@ -989,6 +989,8 @@ static const struct lttng_ust_objd_ops lttng_enabler_ops = {
 void lttng_ust_abi_exit(void)
 {
        lttng_ust_abi_close_in_progress = 1;
+       ust_lock_nocheck();
        objd_table_destroy();
+       ust_unlock();
        lttng_ust_abi_close_in_progress = 0;
 }
This page took 0.02514 seconds and 4 git commands to generate.