1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

lib1559: fix mem-leak in OOM

Closes #4709
This commit is contained in:
Daniel Stenberg 2019-12-12 15:10:47 +01:00
parent 6a15d1d4e5
commit 197d8aaf6d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -34,6 +34,9 @@ int test(char *URL)
CURLU *u; CURLU *u;
(void)URL; (void)URL;
if(!longurl)
return 1;
memset(longurl, 'a', EXCESSIVE); memset(longurl, 'a', EXCESSIVE);
longurl[EXCESSIVE-1] = 0; longurl[EXCESSIVE-1] = 0;
@ -62,15 +65,8 @@ int test(char *URL)
curl_url_cleanup(u); curl_url_cleanup(u);
} }
free(longurl);
curl_easy_cleanup(curl);
curl_global_cleanup();
return 0;
test_cleanup: test_cleanup:
free(longurl);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
curl_global_cleanup(); curl_global_cleanup();