Refactor relayd main/set_options/cleanup
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index d573eb0be1834e4eab521819badd3e04c502d2b0..4a0a07b14ec1a08faba8c2b94199f2ef7a6e7f54 100644 (file)
@@ -226,7 +226,7 @@ int lttng_check_tracing_group(void)
        }
 
        /* Alloc group list of the right size */
-       grp_list = malloc(grp_list_size * sizeof(gid_t));
+       grp_list = zmalloc(grp_list_size * sizeof(gid_t));
        if (!grp_list) {
                perror("malloc");
                goto end;
@@ -446,7 +446,11 @@ int lttng_ctl_ask_sessiond_varlen(struct lttcomm_session_msg *lsm,
                goto end;
        }
 
-       data = (void*) malloc(size);
+       data = zmalloc(size);
+       if (!data) {
+               ret = -ENOMEM;
+               goto end;
+       }
 
        /* Get payload data */
        ret = recv_data_sessiond(data, size);
@@ -486,7 +490,7 @@ struct lttng_handle *lttng_create_handle(const char *session_name,
                goto end;
        }
 
-       handle = malloc(sizeof(struct lttng_handle));
+       handle = zmalloc(sizeof(struct lttng_handle));
        if (handle == NULL) {
                PERROR("malloc handle");
                goto end;
@@ -1212,6 +1216,7 @@ int lttng_disable_event(struct lttng_handle *handle, const char *name,
        struct lttng_event ev;
 
        memset(&ev, 0, sizeof(ev));
+       ev.loglevel = -1;
        ev.type = LTTNG_EVENT_ALL;
        lttng_ctl_copy_string(ev.name, name, sizeof(ev.name));
        return lttng_disable_event_ext(handle, &ev, channel_name, NULL);
This page took 0.024749 seconds and 4 git commands to generate.