From: Jonathan McDowell Date: Sun, 18 Aug 2019 17:49:47 +0000 (+0100) Subject: Fix memory leak in makewordlistfromkey() X-Git-Tag: onak-0.6.0~33 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=2b28bb7cc65dc9594092dff860fd89bd14dd8b27;p=onak.git 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 --- 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; }