diff options
-rw-r--r-- | packages/OS400/ccsidcurl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index b1d3ba845..ca711d0c0 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -219,13 +219,20 @@ slist_convert(int dccsid, struct curl_slist * from, int sccsid) struct curl_slist * to = (struct curl_slist *) NULL; for(; from; from = from->next) { + struct curl_slist *nl; char * cp = dynconvert(dccsid, from->data, -1, sccsid); if(!cp) { curl_slist_free_all(to); return (struct curl_slist *) NULL; } - to = Curl_slist_append_nodup(to, cp); + nl = Curl_slist_append_nodup(to, cp); + if(!nl) { + curl_slist_free_all(to); + free(cp); + return NULL; + } + to = nl; } return to; } |