mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
Clear the urlglob struct when allocated, since we might otherwise use
uninitialized variables. Pointed out to us by the friendly Valgrind.
This commit is contained in:
parent
9a820d7a98
commit
c7f51ebeab
@ -314,7 +314,7 @@ int glob_url(URLGlob** glob, char* url, int *urlnum, FILE *error)
|
|||||||
if(NULL == glob_buffer)
|
if(NULL == glob_buffer)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
glob_expand = (URLGlob*)malloc(sizeof(URLGlob));
|
glob_expand = (URLGlob*)calloc(sizeof(URLGlob), 1);
|
||||||
if(NULL == glob_expand) {
|
if(NULL == glob_expand) {
|
||||||
free(glob_buffer);
|
free(glob_buffer);
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user