From: Mark Wielaard Date: Fri, 18 Jun 2021 13:02:43 +0000 (+0200) Subject: debuginfod-client: Fix client dereference when calloc fails. X-Git-Tag: elfutils-0.186~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c05ad596b5557a1776953be705a4bb66eee911fa;p=thirdparty%2Felfutils.git debuginfod-client: Fix client dereference when calloc fails. When the calloc call in debuginfod_begin fails we should skip all initialization of the client handle. Signed-off-by: Mark Wielaard --- diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 286c910a0..d9d117373 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,8 @@ +2021-06-18 Mark Wielaard + + * debuginfod-client.c (debuginfod_begin): Don't use client if + calloc call failed. + 2021-06-03 Frank Ch. Eigler PR27863 diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index ee7eda24d..f417b40ae 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -1193,12 +1193,12 @@ debuginfod_begin (void) client->verbose_fd = STDERR_FILENO; else client->verbose_fd = -1; - } - // allocate 1 curl multi handle - client->server_mhandle = curl_multi_init (); - if (client->server_mhandle == NULL) - goto out1; + // allocate 1 curl multi handle + client->server_mhandle = curl_multi_init (); + if (client->server_mhandle == NULL) + goto out1; + } // extra future initialization