mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
minor leak in case of error, thanks to "./runtests.pl -n -t 25"
This commit is contained in:
parent
d3999e06d1
commit
853134017d
@ -1777,8 +1777,10 @@ CURLcode Curl_follow(struct SessionHandle *data,
|
|||||||
newest=(char *)malloc( urllen + 1 + /* possible slash */
|
newest=(char *)malloc( urllen + 1 + /* possible slash */
|
||||||
newlen + 1 /* zero byte */);
|
newlen + 1 /* zero byte */);
|
||||||
|
|
||||||
if(!newest)
|
if(!newest) {
|
||||||
|
free(url_clone); /* don't leak this */
|
||||||
return CURLE_OUT_OF_MEMORY; /* go out from this */
|
return CURLE_OUT_OF_MEMORY; /* go out from this */
|
||||||
|
}
|
||||||
|
|
||||||
/* copy over the root url part */
|
/* copy over the root url part */
|
||||||
memcpy(newest, url_clone, urllen);
|
memcpy(newest, url_clone, urllen);
|
||||||
|
Loading…
Reference in New Issue
Block a user