Slightly improve http_download related allocations.
* use `calloc()` to allocate zero-initialized structs. * order the allocation of members by their declaration. * order the freeing of members in reverse order. * move init of `silent` flag in plugin case. * fix double free of `tmpname` in `aesgcm_file_get()`. * make some functions static. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
@@ -62,9 +62,9 @@ plugin_download_install(void* userdata)
|
||||
{
|
||||
HTTPDownload* plugin_dl = (HTTPDownload*)userdata;
|
||||
|
||||
/* We need to dup those, because they're free'd inside `http_file_get()` */
|
||||
auto_char char* path = strdup(plugin_dl->filename);
|
||||
auto_char char* https_url = strdup(plugin_dl->url);
|
||||
plugin_dl->silent = TRUE;
|
||||
|
||||
http_file_get(plugin_dl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user