From c05ad596b5557a1776953be705a4bb66eee911fa Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 18 Jun 2021 15:02:43 +0200 Subject: [PATCH] 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 --- debuginfod/ChangeLog | 5 +++++ debuginfod/debuginfod-client.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) 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 -- 2.47.2