dup_word_list() does the right thing if passed NULL (on general principles)
[sgt/halibut] / malloc.c
index 6612fef..2ff22fd 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -101,7 +101,7 @@ char *dupstr(char *s) {
  * Duplicate a linked list of words
  */
 word *dup_word_list(word *w) {
-    word *head, **eptr = &head;
+    word *head = NULL, **eptr = &head;
 
     while (w) {
        word *newwd = snew(word);