From bf430ecdef3d7c49cf01a57e3289ff7aaa1e0278 Mon Sep 17 00:00:00 2001 From: Miroslav Franc Date: Wed, 13 Jul 2016 18:43:18 +0200 Subject: library: Fix memory leaks found during static analysis Closes https://github.com/curl/curl/pull/913 --- lib/pipeline.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/pipeline.c') diff --git a/lib/pipeline.c b/lib/pipeline.c index 211194b25..0ff82f086 100644 --- a/lib/pipeline.c +++ b/lib/pipeline.c @@ -299,11 +299,16 @@ CURLMcode Curl_pipeline_set_server_blacklist(char **servers, char *server_name; server_name = strdup(*servers); - if(!server_name) + if(!server_name) { + Curl_llist_destroy(new_list, NULL); return CURLM_OUT_OF_MEMORY; + } - if(!Curl_llist_insert_next(new_list, new_list->tail, server_name)) + if(!Curl_llist_insert_next(new_list, new_list->tail, server_name)) { + Curl_llist_destroy(new_list, NULL); + Curl_safefree(server_name); return CURLM_OUT_OF_MEMORY; + } servers++; } -- cgit v1.2.3