Fix: release reference to created chunk if it can't be published
[lttng-tools.git] / src / common / trace-chunk.c
index 40e612800a5c8e6dd31442593d27e94eea81fbbc..9f0919a8896b7756121ffe18d6580e0550637f37 100644 (file)
@@ -656,7 +656,7 @@ int add_top_level_directory_unique(struct lttng_trace_chunk *chunk,
        }
 
        if (!found) {
-               char *copy = strndup(new_path, new_path_top_level_len);
+               char *copy = lttng_strndup(new_path, new_path_top_level_len);
 
                DBG("Adding new top-level directory \"%s\" to trace chunk \"%s\"",
                                new_path, chunk->name ? : "(unnamed)");
@@ -1096,7 +1096,7 @@ end:
        return registry;
 error:
        lttng_trace_chunk_registry_destroy(registry);
-       goto end;
+       return NULL;
 }
 
 LTTNG_HIDDEN
This page took 0.023356 seconds and 4 git commands to generate.