Fix: NULL pointer dereference in relay_index_get_by_id_or_create
[lttng-tools.git] / src / common / utils.c
index d4ff94c7a09680308516e9cd6301b6ce8003844d..25639461cc3ae03e147ff0224364c4db21fb8876 100644 (file)
@@ -121,6 +121,7 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size)
 
                /* Free the allocated memory */
                free(cut_path);
+               cut_path = NULL;
        };
 
        /* Allocate memory for the resolved path if necessary */
@@ -172,6 +173,8 @@ char *utils_partial_realpath(const char *path, char *resolved_path, size_t size)
 error:
        free(resolved_path);
        free(cut_path);
+       free(try_path);
+       free(try_path_prev);
        return NULL;
 }
 
This page took 0.023082 seconds and 4 git commands to generate.