aboutsummaryrefslogtreecommitdiff
path: root/lib/cookie.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cookie.c')
-rw-r--r--lib/cookie.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index fc918136a..b6790677f 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -89,6 +89,7 @@ Example set of cookies:
#include "strequal.h"
#include "strtok.h"
#include "sendf.h"
+#include "slist.h"
#include "curl_memory.h"
#include "share.h"
#include "strtoofft.h"
@@ -1232,9 +1233,9 @@ struct curl_slist *Curl_cookie_list(struct SessionHandle *data)
curl_slist_free_all(list);
return NULL;
}
- beg = curl_slist_append(list, line);
- free(line);
+ beg = Curl_slist_append_nodup(list, line);
if(!beg) {
+ free(line);
curl_slist_free_all(list);
return NULL;
}