Revert "Update to 7.44.0"
[platform/upstream/curl.git] / lib / slist.c
index 8e52c70..3cac6ca 100644 (file)
@@ -59,8 +59,7 @@ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, char *data)
   struct curl_slist     *last;
   struct curl_slist     *new_item;
 
-  if(!data)
-    return NULL;
+  DEBUGASSERT(data);
 
   new_item = malloc(sizeof(struct curl_slist));
   if(!new_item)
@@ -73,10 +72,10 @@ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, char *data)
   if(!list)
     return new_item;
 
-    last = slist_get_last(list);
-    last->next = new_item;
-    return list;
-  }
+  last = slist_get_last(list);
+  last->next = new_item;
+  return list;
+}
 
 /*
  * curl_slist_append() appends a string to the linked list. It always returns
@@ -90,7 +89,7 @@ struct curl_slist *curl_slist_append(struct curl_slist *list,
 {
   char *dupdata = strdup(data);
 
-  if(!data)
+  if(!dupdata)
     return NULL;
 
   list = Curl_slist_append_nodup(list, dupdata);