From 59fe348deaa270434f05afc56ca8d13618af9ca9 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 4 Mar 2013 13:25:38 +0100 Subject: cgit_print_snapshot_links(): Free prefix variable Fixes following memory leak seen with "PATH_INFO=/cgit/commit/": ==16894== 12 bytes in 1 blocks are definitely lost in loss record 9 of 92 ==16894== at 0x4C2C04B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==16894== by 0x56F2DF1: strdup (in /usr/lib/libc-2.17.so) ==16894== by 0x46CAC8: xstrdup (wrapper.c:35) ==16894== by 0x414E34: cgit_print_snapshot_links (ui-shared.c:926) ==16894== by 0x40CFA1: cgit_print_commit (ui-commit.c:102) ==16894== by 0x407B06: commit_fn (cmd.c:54) ==16894== by 0x405E16: process_request (cgit.c:574) ==16894== by 0x4074C8: cache_process (cache.c:322) ==16894== by 0x406C4F: main (cgit.c:872) Signed-off-by: Lukas Fleischer --- ui-shared.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 77a302d..d3e6488 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -931,4 +931,5 @@ void cgit_print_snapshot_links(const char *repo, const char *head, cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename); html("
"); } + free(prefix); } -- cgit v1.2.3