diff --git a/dicepwgen.c b/dicepwgen.c index 9a52653..9a157d0 100644 --- a/dicepwgen.c +++ b/dicepwgen.c @@ -179,5 +179,7 @@ void getwords(char *dictfile, int count) { if (words[i] != NULL) free(words[i]); - free(words); + if (words != NULL) { + free(words); + } }