From nobody Sun Feb 8 17:04:17 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=1601850260; cv=none; d=zohomail.com; s=zohoarc; b=UgA36V6DcNrtyauFVJJoxpjUBHpJOVcgVWBEydSV1oqpK5iLX3aBxawvoX34cNookY9ZVcom4c4xImA59g0cBh7bQ80cvo0Qp4AYWDhBqh04vBjitwk+aX7ewM4M5p9M+soy0lXeYQbjyW6wn/YdrgZngTPJFZhEs6+/Xnuxee8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601850260; h=Content-Type:Content-Transfer-Encoding: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=24SIEnzz0E/KpWO37TGSOcvLbnTHAH8C6EqsnZfTp18=; b=dvngWwN/g4zJLJ347I4Z9vJzDTh+miItc58oiuaAu38xGprXebuW1EkOAILODp0uN1hds8ve08qhop4UbVW6r0Aay7WMtxDRey2Sc+/vok12ZLQD64PI0QodQa84Snp1HJSjrjjzNizEkCBXlGvifSWwdJFLXMI/+v/kq6CyV5U= 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 1601850260791952.9748123989488; Sun, 4 Oct 2020 15:24:20 -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-48-34Kl1qWbMfKKg0PsMz7FNg-1; Sun, 04 Oct 2020 18:24:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 700EF802B48; Sun, 4 Oct 2020 22:24:11 +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 4E2CD19697; Sun, 4 Oct 2020 22:24:11 +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 1B1FD44A5D; Sun, 4 Oct 2020 22:24:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 094MO9Ud031929 for ; Sun, 4 Oct 2020 18:24:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95B6A5C22E; Sun, 4 Oct 2020 22:24:09 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CFB25C22B for ; Sun, 4 Oct 2020 22:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601850259; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=24SIEnzz0E/KpWO37TGSOcvLbnTHAH8C6EqsnZfTp18=; b=OjLJdrZVjQJvJbRyo123ICvtToErS16RjyGcHrblOiCq/2GS522PVZmV/azktogQKfoJnz 9H+MH+Tg/P21b5wUm8ZbeqV/bBsI/UqFaxADayU4PsTbiX1iRNYnBu0FnOdKfYdKgRHJ0n nkVLsHhZWNWL4d4JjzqKpU9vQJlFx1c= X-MC-Unique: 34Kl1qWbMfKKg0PsMz7FNg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] vz: vzEatCookie: separate allocation Date: Mon, 5 Oct 2020 00:23:58 +0200 Message-Id: <66fa507cd32930e22a701fb9081eb77d2416a7c4.1601850220.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Use g_new0 outside of the error condition. Signed-off-by: J=C3=A1n Tomko --- src/vz/vz_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index dad7fe37b7..a83d4117a4 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -2807,9 +2807,9 @@ vzEatCookie(const char *cookiein, int cookieinlen, un= signed int flags) =20 if (flags & VZ_MIGRATION_COOKIE_SESSION_UUID) { g_autofree char *tmp =3D NULL; + mig->session_uuid =3D g_new0(unsigned char, VIR_UUID_BUFLEN); =20 if ((!(tmp =3D virXPathString("string(./session-uuid[1])", ctx)) - || (VIR_ALLOC_N(mig->session_uuid, VIR_UUID_BUFLEN) < 0) || (virUUIDParse(tmp, mig->session_uuid) < 0))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing or malformed session-uuid element " @@ -2820,9 +2820,9 @@ vzEatCookie(const char *cookiein, int cookieinlen, un= signed int flags) =20 if (flags & VZ_MIGRATION_COOKIE_DOMAIN_UUID) { g_autofree char *tmp =3D NULL; + mig->uuid =3D g_new0(unsigned char, VIR_UUID_BUFLEN); =20 if ((!(tmp =3D virXPathString("string(./uuid[1])", ctx)) - || (VIR_ALLOC_N(mig->uuid, VIR_UUID_BUFLEN) < 0) || (virUUIDParse(tmp, mig->uuid) < 0))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing or malformed uuid element in migrati= on data")); --=20 2.26.2