X-Git-Url: http://the.earth.li/gitweb/?p=onak.git;a=blobdiff_plain;f=wordlist.c;h=6827ba282db2ecc5a7a64e2a02238d4a85991c27;hp=605ec06967752a4209be7591c966d2209f6618d3;hb=76f079e5ebdb34acaaa2462a8d915ee06d3c8425;hpb=5e1b22d763640c4d7a09d07920403d8d491b4410 diff --git a/wordlist.c b/wordlist.c index 605ec06..6827ba2 100644 --- a/wordlist.c +++ b/wordlist.c @@ -13,17 +13,17 @@ * more details. * * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * this program. If not, see . */ #include #include +#include #include #include "ll.h" #include "decodekey.h" -#include "log.h" +#include "keystructs.h" #include "wordlist.h" /** @@ -97,7 +97,7 @@ struct ll *makewordlistfromkey(struct ll *wordlist, struct ll *wl = NULL; uids = keyuids(key, NULL); - for (i = 0; uids[i] != NULL; ++i) { + for (i = 0; uids != NULL && uids[i] != NULL; ++i) { words = makewordlist(NULL, uids[i]); for (wl = words; wl != NULL; wl = wl->next) { if (llfind(wordlist, wl->object, @@ -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; }