From d8ccf27333d51de25e1f49a33028175ecba596c0 Mon Sep 17 00:00:00 2001
From: Rob Ward <rob@rob-ward.co.uk>
Date: Wed, 27 Jun 2012 21:13:53 +0100
Subject: [PATCH 1/2] Modify slist_append to stop failure on NULL data

Changes curl_slist_append so that if data to be added to list
is passed in as a NULL value then no Segfault is triggered.

This is acheived by detecting NULL value and returning the
original list.
---
 lib/slist.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/slist.c b/lib/slist.c
index 4ddebb6..cf01d93 100644
--- a/lib/slist.c
+++ b/lib/slist.c
@@ -58,6 +58,11 @@ struct curl_slist *curl_slist_append(struct curl_slist *list,
   struct curl_slist     *last;
   struct curl_slist     *new_item;
 
+  if(!data) {
+    /*data passed in is NULL so return original list*/
+    return list;
+  }
+
   new_item = malloc(sizeof(struct curl_slist));
   if(new_item) {
     char *dupdata = strdup(data);
-- 
1.7.9.5

