From nobody Mon Feb 9 10:48:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600070537; cv=none; d=zohomail.com; s=zohoarc; b=H207pjnasLUd2ASb1bqfICxXuXpxwW9UJEN8PhCb1I+Qp5qBm4AXHMUtj0Hf8Auk42Itl9kn3q5XZSU+9sgmkL+cM3e4K4Q/kBhZOhCtc9f2/wgtixciPp/M6HaI7f0KeA+TX10CNmtlA0FBkKvlWJghfttVInN2Yk9MrBhI26A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600070537; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g9zh2CSROV5yrsy/JXdqDz238bcEorGn1cpobkNdjy4=; b=fqJo2RGwXDtcRR7syEFJ/fAc0x+baJagKOzaSEW3sAbp9I9NIYBBOMo6N6Jul1h1zrVpr3XQVeTJdu1HnEV5hfNe2n/Ska66ULKrlyAWrKD7p2m7O+qYv9jzupyfmQ3Nzo9XCWwyxSYMsXU+6snrJfAY9sQcLGFV2qc4I+Yi460= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600070537954315.14865543076337; Mon, 14 Sep 2020 01:02:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-Q245nbQRN7aE6VCHJIOYiQ-1; Mon, 14 Sep 2020 04:02:14 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C11281005E6D; Mon, 14 Sep 2020 08:02:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0A365DA60; Mon, 14 Sep 2020 08:02:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6F2048C7C9; Mon, 14 Sep 2020 08:02:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08E8265n008783 for ; Mon, 14 Sep 2020 04:02:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id D526D1A8AC; Mon, 14 Sep 2020 08:02:06 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-156.ams2.redhat.com [10.36.112.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18C9A19C66; Mon, 14 Sep 2020 08:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600070536; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g9zh2CSROV5yrsy/JXdqDz238bcEorGn1cpobkNdjy4=; b=W63wdDdcf0A2I84ouwQE2VOEjJeUFA6DX6+sVmbApA1x/KsqEgnYU4CTv/s/DRyWRuaNRV q5/09qfhwKsoTJytpbFt2G7CwfsTI8K6GzpAs1pQNGQ6M70ry4GTczTGy8lT5fmD0/ktaL aHEvZJMiOSXbpY5G0RqsRnqzMH5ko9A= X-MC-Unique: Q245nbQRN7aE6VCHJIOYiQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/7] util: Use glib memory functions in virLastErrorObject Date: Mon, 14 Sep 2020 10:01:50 +0200 Message-Id: <20200914080154.26361-4-twiederh@redhat.com> In-Reply-To: <20200914080154.26361-1-twiederh@redhat.com> References: <20200914080154.26361-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/util/virerror.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index d89948f198..80a7cfe0ed 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -235,10 +235,9 @@ virLastErrorObject(void) virErrorPtr err; err =3D virThreadLocalGet(&virLastErr); if (!err) { - if (VIR_ALLOC_QUIET(err) < 0) - return NULL; + err =3D g_new0(virError, 1); if (virThreadLocalSet(&virLastErr, err) < 0) - VIR_FREE(err); + g_clear_pointer(&err, g_free); } return err; } --=20 2.26.2