From 81707c4a30d90b80ed4732d934db8c170cd9ccfa Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 8 Oct 2022 15:01:15 +0200 Subject: [PATCH] Fix memory leak, the path is always allocated on the heap --- src/vrt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vrt.c b/src/vrt.c index bdb1119..6fe6330 100644 --- a/src/vrt.c +++ b/src/vrt.c @@ -410,8 +410,7 @@ int vrt_closedir(DIR_P *iter) { } } - // root path is not allocated - if (iter->path && *iter->path != 0) { + if (iter->path) { free(iter->path); iter->path = NULL; }