Skip to content
Snippets Groups Projects
Commit 5dcab07c authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

if a malloc fails, clear up the memory and return failure

parent 1f798aff
No related branches found
No related tags found
No related merge requests found
......@@ -705,6 +705,16 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
/* point the main to us */
mainco = newco;
}
else {
/* failure, clear up the allocated chain and return NULL */
while(mainco) {
co = mainco->next;
free(mainco);
mainco = co;
}
return NULL;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment