Fix: lttng: add-trigger: leak of source argument
[lttng-tools.git] / src / bin / lttng / commands / add_trigger.c
index 401fa762ece18648ab2fedd2b0a43f92292ee9f5..eecda501464c6d07ba96afee6ed3427e8e660dbd 100644 (file)
@@ -252,7 +252,7 @@ static int parse_kernel_probe_opts(const char *source,
 
                        *location = lttng_kernel_probe_location_symbol_create(
                                        symbol_name, 0);
-                       if (!location) {
+                       if (!*location) {
                                ERR("Failed to create symbol kernel probe location.");
                                goto error;
                        }
@@ -789,6 +789,7 @@ end:
        free(filter);
        free(exclude);
        free(loglevel_str);
+       free(source);
        strutils_free_null_terminated_array_of_strings(exclusion_list);
        lttng_kernel_probe_location_destroy(kernel_probe_location);
        lttng_userspace_probe_location_destroy(userspace_probe_location);
@@ -1114,6 +1115,7 @@ error:
        lttng_action_destroy(action);
        action = NULL;
        free(error);
+       argpar_item_destroy(item);
 end:
        return action;
 }
@@ -1440,6 +1442,7 @@ end:
        free(data_url_arg);
        free(snapshot_output);
        argpar_state_destroy(state);
+       argpar_item_destroy(item);
        return action;
 }
 
This page took 0.024193 seconds and 4 git commands to generate.