mirror of
https://github.com/curl/curl.git
synced 2026-05-14 17:06:24 +03:00
curl: free resource in error path
If the new filename cannot be generated due to memory pressure, free the allocated aname on the way out to avoid a small leak. Closes: #8770 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
This commit is contained in:
parent
6d86193377
commit
a7b29122cb
1 changed files with 1 additions and 0 deletions
|
|
@ -99,6 +99,7 @@ bool tool_create_output_file(struct OutStruct *outs,
|
|||
newname = malloc(newlen);
|
||||
if(!newname) {
|
||||
errorf(global, "out of memory\n");
|
||||
free(aname);
|
||||
return FALSE;
|
||||
}
|
||||
memcpy(newname, fname, len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue