From 101cb879ba853eabf714020eb09f138bc58c8c9c Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 17 Sep 2018 01:49:31 -0700 Subject: free path string after opening file --- journal.c | 1 + 1 file changed, 1 insertion(+) (limited to 'journal.c') diff --git a/journal.c b/journal.c index 39354fd..c7bd9ba 100644 --- a/journal.c +++ b/journal.c @@ -37,6 +37,7 @@ static void print_entry(char *entry) memcpy(path, ENTRY_DIR"/", sizeof(ENTRY_DIR)); memcpy(path + sizeof(ENTRY_DIR), entry, len); FILE *f = fopen(path, "r"); + free(path); if (!f) return; char date[11]; -- cgit v1.2.3-70-g09d2