aboutsummaryrefslogtreecommitdiff
path: root/src/checkpath
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-03-29 09:05:59 +0100
committerWilliam Hubbs <w.d.hubbs@gmail.com>2022-05-08 14:56:26 -0500
commitadc1e33f7e673d90b2ce169a3da337c6c22b6518 (patch)
treeb7b7f89ccb842d1f8957f25130f63a404adf428e /src/checkpath
parente7f45ce31fc95d4d3cd387d2d4452fd16546101e (diff)
checkpath: fix memory leak
``` Direct leak of 4 byte(s) in 1 object(s) allocated from: #0 0x7f49539534a7 in __interceptor_strdup /usr/src/debug/sys-devel/gcc-11.2.1_p20220312/gcc-11-20220312/libsanitizer/asan/asan_interceptors.cpp:454 #1 0x55d76fa66867 in xstrdup ../src/includes/helpers.h:91 #2 0x55d76fa66867 in get_dirfd ../src/rc/checkpath.c:111 #3 0x55d76fa66867 in do_check ../src/rc/checkpath.c:206 #4 0x55d76fa66867 in main ../src/rc/checkpath.c:442 #5 0x7f49536f06cf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 ``` Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'src/checkpath')
-rw-r--r--src/checkpath/checkpath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/checkpath/checkpath.c b/src/checkpath/checkpath.c
index de5d1b4a..42864276 100644
--- a/src/checkpath/checkpath.c
+++ b/src/checkpath/checkpath.c
@@ -140,6 +140,8 @@ static int get_dirfd(char *path, bool symlinks)
item = strtok(NULL, "/");
components--;
}
+
+ free(str);
}
free(path_dupe);
free(linkpath);