From 2b28bb7cc65dc9594092dff860fd89bd14dd8b27 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Sun, 18 Aug 2019 18:49:47 +0100 Subject: [PATCH] Fix memory leak in makewordlistfromkey() We were building a linked list of words in each UID, but then not cleaning up this linked list when we were done with it. Found with gcc -fsanitize=leak --- wordlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wordlist.c b/wordlist.c index 0feeb82..6827ba2 100644 --- a/wordlist.c +++ b/wordlist.c @@ -106,6 +106,7 @@ struct ll *makewordlistfromkey(struct ll *wordlist, wordlist = lladd(wordlist, strdup(wl->object)); } } + llfree(words, NULL); free(uids[i]); uids[i] = NULL; } -- 2.39.2