mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-10-04 15:58:22 +00:00
download: Abort on calloc fail
This commit is contained in:
committed by
Matthew Johnson
parent
489a11adfc
commit
bdb6d1cebd
@@ -146,6 +146,9 @@ static void free_curl_file(struct swupd_curl_parallel_handle *h, struct multi_cu
|
||||
void *swupd_curl_parallel_download_start(size_t max_xfer, size_t max_xfer_bottom, swupd_curl_download_cb success_cb)
|
||||
{
|
||||
struct swupd_curl_parallel_handle *h = calloc(1, sizeof(struct swupd_curl_parallel_handle));
|
||||
if (!h) {
|
||||
abort();
|
||||
}
|
||||
|
||||
h->mcurl = curl_multi_init();
|
||||
if (h->mcurl == NULL) {
|
||||
@@ -424,6 +427,9 @@ int swupd_curl_parallel_download_enqueue(void *handle, const char *url, const ch
|
||||
h = handle;
|
||||
|
||||
file = calloc(1, sizeof(struct multi_curl_file));
|
||||
if (!file) {
|
||||
abort();
|
||||
}
|
||||
file->file.path = strdup_or_die(filename);
|
||||
file->url = strdup_or_die(url);
|
||||
file->data = data;
|
||||
|
||||
Reference in New Issue
Block a user