dup_word_list() does the right thing if passed NULL (on general principles)
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 6 Aug 2004 00:31:35 +0000 (00:31 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 6 Aug 2004 00:31:35 +0000 (00:31 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/halibut@4410 cda61777-01e9-0310-a592-d414129be87e

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);