From nobody Wed May 1 03:12:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155049285905454.78337086844488; Mon, 18 Feb 2019 04:27:39 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 00F7B88E58; Mon, 18 Feb 2019 12:27:37 +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 35DB7600C8; Mon, 18 Feb 2019 12:27:36 +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 3170C3F7CD; Mon, 18 Feb 2019 12:27:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1ICRYx6010937 for ; Mon, 18 Feb 2019 07:27:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2D1945D70E; Mon, 18 Feb 2019 12:27:34 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id A41D85D70A for ; Mon, 18 Feb 2019 12:27:30 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 18 Feb 2019 13:27:30 +0100 Message-Id: <50ea8778008781287a65fa6e6cf06f5ebf3cce28.1550492850.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] util: Use virStorageSourceNew in virStorageFileMetadataNew 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 18 Feb 2019 12:27:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Commit dcda2bf4c110 forgot to fix this one instance. Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- src/util/virstoragefile.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 5927140a66..b2e308d81d 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1119,22 +1119,20 @@ static virStorageSourcePtr virStorageFileMetadataNew(const char *path, int format) { - virStorageSourcePtr def =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) def =3D NULL; + virStorageSourcePtr ret =3D NULL; - if (VIR_ALLOC(def) < 0) + if (!(def =3D virStorageSourceNew())) return NULL; def->format =3D format; def->type =3D VIR_STORAGE_TYPE_FILE; if (VIR_STRDUP(def->path, path) < 0) - goto error; - - return def; + return NULL; - error: - virObjectUnref(def); - return NULL; + VIR_STEAL_PTR(ret, def); + return ret; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list