Link_download_full: don't FREE(NULL)

It's entirely possible that `ts.data` is `NULL` on an error path, so
handing it to `FREE()`, which bails on a `NULL` argument, is not ideal.
Just pass it to `free()` instead, which is required to no-op if given
`NULL`.
This commit is contained in:
Nathaniel Wesley Filardo 2022-11-01 01:54:35 +00:00
parent 833cbf9d67
commit ff5f566dd9
1 changed files with 1 additions and 1 deletions

View File

@ -860,7 +860,7 @@ TransferStruct Link_download_full(Link *link)
lprintf(warning,
"cannot retrieve URL: %s, HTTP %ld\n", url, http_resp);
ts.curr_size = 0;
FREE(ts.data);
free(ts.data); /* not FREE(); can be NULL on error path! */
curl_easy_cleanup(curl);
return ts;
}