From fc9cdb58855ca1b81357359123c1bac6e5c7e9e1 Mon Sep 17 00:00:00 2001 From: Kasper Date: Fri, 2 May 2025 00:17:31 +0300 Subject: [PATCH] Use the same pointer from FileWatch to refer to the entry in a parent FileWatch --- src/filewatcher/filewatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filewatcher/filewatch.c b/src/filewatcher/filewatch.c index a4045f8..85b36ee 100644 --- a/src/filewatcher/filewatch.c +++ b/src/filewatcher/filewatch.c @@ -140,7 +140,7 @@ HiResult file_watch_add(FileWatcherContext *ctx, u32 mask, int wd = inotify_add_watch(ctx->fd, parent_name, params.parent_mask); FileWatch wp = {.wd = wd, .mask = HI_FILE_PARENT, .path = parent_name}; sc_array_init(&wp.files); - sc_array_add(&wp.files, strdup(watch->path)); + sc_array_add(&wp.files, watch->path); sc_array_add(&ctx->watches, wp); } else { free(parent_name);