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:
parent
833cbf9d67
commit
ff5f566dd9
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue