From nobody Tue May 21 17:18:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618833300; cv=none; d=zohomail.com; s=zohoarc; b=iZL8+A2hfIx/ZTa2y+PlMvCBbw19d6IynbUj2JJ3kMz0eHlpGlkq+uDBP8KvYDDdGa3PnZyTYMVicSLnbyEdvZQFhIePh51U084/CfZyZBAFifLayDb1ZO1a6LfzmoVfdJoIau/68UJWeCWjE87lik4n4T2ZHJ8MCIlbP54CWlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618833300; 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=FG/W3pkuTuLW06/fR8LqQBRTSyinb75F6f5DtQUD7pY=; b=lgdd+h443+DI6IaGqq1BCFXZTMqCu1Itqey5hgkuBJOSRJPtNpzoXe6voONWuZW1iMo7jSwu56A2ZWv2ZgIA8fN+sUHdle8xh1a04iAQUBCyDr66Pbnj3Rw1wtIqp9Fw2uqb3vtLDHruI2k4kmpsrW5lg3E7yHhlm7zjfpZDpEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618833300173867.3903168677726; Mon, 19 Apr 2021 04:55:00 -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-537-S4awOGr-OLqaDJGknU7aeQ-1; Mon, 19 Apr 2021 07:54:56 -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 6E2106D241; Mon, 19 Apr 2021 11:54:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B70360C04; Mon, 19 Apr 2021 11:54:50 +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 853C41806D1C; Mon, 19 Apr 2021 11:54:49 +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 13JBsfYt012839 for ; Mon, 19 Apr 2021 07:54:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7DD3E5C1D0; Mon, 19 Apr 2021 11:54:41 +0000 (UTC) Received: from work.redhat.com (ovpn-113-106.ams2.redhat.com [10.36.113.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BFDA5C1CF; Mon, 19 Apr 2021 11:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618833299; 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=FG/W3pkuTuLW06/fR8LqQBRTSyinb75F6f5DtQUD7pY=; b=MMou0QvOjacs1JypgNuy9MXwtbAWZr1izHO3eDlry7ljcEQIJcY2qiNEv04spUJOCK+jff VZ1KthWmNhcXlxcbXU8cYA32A7pp16zXIvgq7JrxiO9kspTHFUD2EjVLml29O7cIilggvd z5evr2XTO8CI/P8c4LpO530+0yaQJ2U= X-MC-Unique: S4awOGr-OLqaDJGknU7aeQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/5] xenParseHypervisorFeatures: Fix memory leak Date: Mon, 19 Apr 2021 13:54:11 +0200 Message-Id: <20210419115415.19145-2-twiederh@redhat.com> In-Reply-To: <20210419115415.19145-1-twiederh@redhat.com> References: <20210419115415.19145-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Fixes:b523e22521afe733165869c9e1ae18e88536acd6 Signed-off-by: Tim Wiederhake Reviewed-by: Laine Stump --- src/libxl/xen_common.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 12a44280cb..6fa69fbdf0 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -543,14 +543,15 @@ xenParseCPU(virConf *conf, static int xenParseHypervisorFeatures(virConf *conf, virDomainDef *def) { - g_autofree char *strval =3D NULL; + g_autofree char *tscmode =3D NULL; + g_autofree char *passthrough =3D NULL; virDomainTimerDef *timer; int val =3D 0; =20 - if (xenConfigGetString(conf, "tsc_mode", &strval, NULL) < 0) + if (xenConfigGetString(conf, "tsc_mode", &tscmode, NULL) < 0) return -1; =20 - if (strval) { + if (tscmode) { VIR_EXPAND_N(def->clock.timers, def->clock.ntimers, 1); =20 timer =3D g_new0(virDomainTimerDef, 1); @@ -559,37 +560,38 @@ xenParseHypervisorFeatures(virConf *conf, virDomainDe= f *def) timer->tickpolicy =3D -1; timer->mode =3D VIR_DOMAIN_TIMER_MODE_AUTO; timer->track =3D -1; - if (STREQ_NULLABLE(strval, "always_emulate")) + if (STREQ_NULLABLE(tscmode, "always_emulate")) timer->mode =3D VIR_DOMAIN_TIMER_MODE_EMULATE; - else if (STREQ_NULLABLE(strval, "native")) + else if (STREQ_NULLABLE(tscmode, "native")) timer->mode =3D VIR_DOMAIN_TIMER_MODE_NATIVE; - else if (STREQ_NULLABLE(strval, "native_paravirt")) + else if (STREQ_NULLABLE(tscmode, "native_paravirt")) timer->mode =3D VIR_DOMAIN_TIMER_MODE_PARAVIRT; =20 def->clock.timers[def->clock.ntimers - 1] =3D timer; + VIR_FREE(tscmode); } =20 - if (xenConfigGetString(conf, "passthrough", &strval, NULL) < 0) + if (xenConfigGetString(conf, "passthrough", &passthrough, NULL) < 0) return -1; =20 - if (strval) { - if (STREQ(strval, "disabled")) { + if (passthrough) { + if (STREQ(passthrough, "disabled")) { def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= OFF; def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_OFF; - } else if (STREQ(strval, "enabled")) { + } else if (STREQ(passthrough, "enabled")) { def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= ON; def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_ON; - } else if (STREQ(strval, "sync_pt")) { + } else if (STREQ(passthrough, "sync_pt")) { def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= ON; def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_ON; def->xen_passthrough_mode =3D VIR_DOMAIN_XEN_PASSTHROUGH_MODE_= SYNC_PT; - } else if (STREQ(strval, "share_pt")) { + } else if (STREQ(passthrough, "share_pt")) { def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= ON; def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_ON; def->xen_passthrough_mode =3D VIR_DOMAIN_XEN_PASSTHROUGH_MODE_= SHARE_PT; } else { virReportError(VIR_ERR_CONF_SYNTAX, - _("Invalid passthrough mode %s"), strval); + _("Invalid passthrough mode %s"), passthrough); } } =20 --=20 2.26.3 From nobody Tue May 21 17:18:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618833306; cv=none; d=zohomail.com; s=zohoarc; b=JYScg4Yeg5Q++Dd8LTNLbEnJCxP26QtF0d6enC9UIK2NCY3TVgaM/weuuRwIqVzJ9ReErf5rVOtSbnVlZXHAdOMwRGkaXIqU7Jft3bjg7hSvNnhLqZEtiAgzd2eunTg66kWfxY7VD5R9C4ixa6UT7dYhEsHC2RR3k9KB7+ptz1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618833306; 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=zalVDK4+xlY+QDk1HdKOW/YrvhCXlMRYXRadSs89MN4=; b=QDhdM+Mi7RSPKxcyaziAOOnTInmhDvO1iC40Rbsmwsd6AiYqda3a6rz89jF1eg1TtezsYu57JBgWq7QhSmbS4GK6Xgb/5woyyGKN7oxcLqf1B//rA057cA1/r/0NTAmH4KNg71/Mb8b7gh/d9Kd2ULIe42Hx/uK7nAwTIFhAUWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618833306201955.6728549643934; Mon, 19 Apr 2021 04:55:06 -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-42-B12gttpvNQyUdEACvOhQcA-1; Mon, 19 Apr 2021 07:55:02 -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 034216D24E; Mon, 19 Apr 2021 11:54:57 +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 CC52160C04; Mon, 19 Apr 2021 11:54:56 +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 8B1F444A57; Mon, 19 Apr 2021 11:54:56 +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 13JBsgDN012844 for ; Mon, 19 Apr 2021 07:54:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id B46F15C1CF; Mon, 19 Apr 2021 11:54:42 +0000 (UTC) Received: from work.redhat.com (ovpn-113-106.ams2.redhat.com [10.36.113.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id D15095C1C4; Mon, 19 Apr 2021 11:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618833305; 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=zalVDK4+xlY+QDk1HdKOW/YrvhCXlMRYXRadSs89MN4=; b=dqpk+q32BKb7Q+FxK2P4QoYvVzJIGBkGt9Bd3KWf2bJpHcyueDxBXxB8XzxKulJwe6S7d5 NfrfV7UPVGSyEbn85+SlUcGTz7Pg0XEFuthhRxX6tH8qE5kBcIoq2ZPb7pwcUgmdvLkmXH 7kHknVL07ek2vkhVOPynL6C7kXjpfVA= X-MC-Unique: B12gttpvNQyUdEACvOhQcA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/5] virDomainFeaturesDefParse: Fix memory leak Date: Mon, 19 Apr 2021 13:54:12 +0200 Message-Id: <20210419115415.19145-3-twiederh@redhat.com> In-Reply-To: <20210419115415.19145-1-twiederh@redhat.com> References: <20210419115415.19145-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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.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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Fixes: 94013ee04e3945307a71f5c4897d78729e7eaff4 Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 17bbeddec6..356398294e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19007,12 +19007,12 @@ virDomainFeaturesDefParse(virDomainDef *def, int feature; int value; g_autofree char *ptval =3D NULL; - g_autofree char *tmp =3D NULL; =20 if ((n =3D virXPathNodeSet("./features/xen/*", ctxt, &nodes)) < 0) return -1; =20 for (i =3D 0; i < n; i++) { + g_autofree char *tmp =3D NULL; feature =3D virDomainXenTypeFromString((const char *)nodes[i]-= >name); if (feature < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, --=20 2.26.3 From nobody Tue May 21 17:18:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618833309; cv=none; d=zohomail.com; s=zohoarc; b=m67m+mbOGuQyfnOV35ToXdTqw843K5psypsifYUujXpTetCaxog1CX781JFNjkCkd9kr/U8dO2MIpGPAnEQQsPlxa/qpKY+kVkDNzEzmlQ+CYM832efIcrqLgxwQADq+G3wPsDYQYeIZ+4pJqkj2DBifVRPTY0AreKBPJsYjK4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618833309; 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=Y0Ae4xUxKqYZafEtoNZLOP/Z5+VnUS5/cgM3k5RSKi8=; b=STUcVcK3FbxS8UdQo1b8BZTnfkjs2RhyF/K/oSky0998YA1aQ8d5rX4f1dFJPGshm2agFV1j0eHQpd3Hw/KauJgys/wNCl5LlqkcMZyN2eH7wTIZ8ZdyWlyB+/P2LU/eEClKRkv/8itAKM+VfLHCnHWUGWkDjy/5nEPUwgCxoN8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618833309820234.15656337391306; Mon, 19 Apr 2021 04:55:09 -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-355-xSiVNBZbP_aOqLlkTz8VGw-1; Mon, 19 Apr 2021 07:55:06 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA42983DD23; Mon, 19 Apr 2021 11:54:59 +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 C0D45100763B; Mon, 19 Apr 2021 11:54:59 +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 8686B44A5E; Mon, 19 Apr 2021 11:54:59 +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 13JBsmF8012863 for ; Mon, 19 Apr 2021 07:54:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EE5F5C1D0; Mon, 19 Apr 2021 11:54:48 +0000 (UTC) Received: from work.redhat.com (ovpn-113-106.ams2.redhat.com [10.36.113.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id D18E85C1C4; Mon, 19 Apr 2021 11:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618833308; 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=Y0Ae4xUxKqYZafEtoNZLOP/Z5+VnUS5/cgM3k5RSKi8=; b=fvmeJJb2DYCAsV56hotFfCqGzf0VEItIKyzfhPQD6YxFacXuU2wu92Y/yvBPmV+h+JTj7M 35xwIAMD1obSmyx1GPVIeFJbAUZ6kYV7uubEIjEz5DhAU+Eu/m7ix8sS/T9Jow1wY/FFIZ ONx1urBAhM3d1UsTdxLeIfDFMHzWho4= X-MC-Unique: xSiVNBZbP_aOqLlkTz8VGw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/5] cmdCheckpointList: Fix memory leak Date: Mon, 19 Apr 2021 13:54:13 +0200 Message-Id: <20210419115415.19145-4-twiederh@redhat.com> In-Reply-To: <20210419115415.19145-1-twiederh@redhat.com> References: <20210419115415.19145-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Fixes: 3caa28dc50df7ec215713075d669b20bef6473a2 Signed-off-by: Tim Wiederhake Reviewed-by: Laine Stump --- tools/virsh-checkpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 20a02b0b02..afe849dd16 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -721,7 +721,6 @@ cmdCheckpointList(vshControl *ctl, virDomainCheckpointPtr checkpoint =3D NULL; long long creation_longlong; g_autoptr(GDateTime) then =3D NULL; - g_autofree gchar *thenstr =3D NULL; bool tree =3D vshCommandOptBool(cmd, "tree"); bool name =3D vshCommandOptBool(cmd, "name"); bool from =3D vshCommandOptBool(cmd, "from"); @@ -804,6 +803,7 @@ cmdCheckpointList(vshControl *ctl, } =20 for (i =3D 0; i < checkpointlist->nchks; i++) { + g_autofree gchar *thenstr =3D NULL; const char *chk_name; =20 /* free up memory from previous iterations of the loop */ --=20 2.26.3 From nobody Tue May 21 17:18:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618833364; cv=none; d=zohomail.com; s=zohoarc; b=JwYGgaU+KAU+HPybNkM/v19wo7V8EF3IQ/cd2MMr8Zmm6kUnH+Cl9IeVPV/63EHrErUv7d+2bWagyQhI0VPv9eqGrUACN7vOit6Sub5E3okqCL73aPYrs3zbr+9o86t0bG7O8D3r8P9pE4O8aZK3XC6yCkoCA0rT5B1+BTseXYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618833364; 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=e29Pc8j0dDO8sh2ZNlmLnfgkAQV65NtQJxHsssOCnqc=; b=B8XTyZo7LiEggi15u0wAiGK5qyeEsbJ85+zc6vDaSAAN4z/55EyneWx1LPn87jkCv8ZJFZvhoMrO9Xyf4ukWLP3R2eHSFOYKw95wzAkYQDMCz62fRA7RlZf8fEVOV/qxdz/r4Ie63+GvfN6AEQKhxSFRdFr15bq/OfWa1dF1NiI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618833364375444.56218179033556; Mon, 19 Apr 2021 04:56:04 -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-118-mXW5fj8EPX6I3sAMI14FPQ-1; Mon, 19 Apr 2021 07:55:08 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08642802B78; Mon, 19 Apr 2021 11:55:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD90D100763B; Mon, 19 Apr 2021 11:55:03 +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 87080180B654; Mon, 19 Apr 2021 11:55:03 +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 13JBsnY5012868 for ; Mon, 19 Apr 2021 07:54:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id CF1975C1CF; Mon, 19 Apr 2021 11:54:49 +0000 (UTC) Received: from work.redhat.com (ovpn-113-106.ams2.redhat.com [10.36.113.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6FDE5C1C4; Mon, 19 Apr 2021 11:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618833363; 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=e29Pc8j0dDO8sh2ZNlmLnfgkAQV65NtQJxHsssOCnqc=; b=bF46sdVt8xPmiLAq3oAJT6r8UvwZi07Mkbfivycve/nKA8DwGpyM5uKYpMo6YxBL0YhFjn sfUdieCOuCDYmmO+9DPgFVB8lCFUm9ixVFOrXdcz+7biqxVviICRI280v1B/hZBom4wQlX zL/Uc+9SvPkr08f/dwoZvv3t3jiJW1M= X-MC-Unique: mXW5fj8EPX6I3sAMI14FPQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 4/5] cmdSnapshotList: Fix memory leak Date: Mon, 19 Apr 2021 13:54:14 +0200 Message-Id: <20210419115415.19145-5-twiederh@redhat.com> In-Reply-To: <20210419115415.19145-1-twiederh@redhat.com> References: <20210419115415.19145-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Fixes: 3caa28dc50df7ec215713075d669b20bef6473a2 Signed-off-by: Tim Wiederhake Reviewed-by: Laine Stump --- tools/virsh-snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 2bec722c61..e64117785c 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1497,7 +1497,6 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) char *state =3D NULL; long long creation_longlong; g_autoptr(GDateTime) then =3D NULL; - g_autofree gchar *thenstr =3D NULL; bool tree =3D vshCommandOptBool(cmd, "tree"); bool name =3D vshCommandOptBool(cmd, "name"); bool from =3D vshCommandOptBool(cmd, "from"); @@ -1592,6 +1591,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) } =20 for (i =3D 0; i < snaplist->nsnaps; i++) { + g_autofree gchar *thenstr =3D NULL; const char *snap_name; =20 /* free up memory from previous iterations of the loop */ --=20 2.26.3 From nobody Tue May 21 17:18:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618833597; cv=none; d=zohomail.com; s=zohoarc; b=ETmbjSVnUH34s21pyjipL4yMe8N+tVf+kN+YZKIPgFOKxS0MCYepqUo7NMN0tuHxXNeNRRJ/BgDXe7uHByOCoB+6gp5CukwqHWXxANn5cZU98q4JqRzIZUP42xqoPh8LNV0twSB7OBSOsMeBzAph0ih9WykbmQnR4bj8Ve4gRTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618833597; 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=c/iioGriW45z3NsJAhLFkblApHM4irDlPW9FtVbK6Sg=; b=k2zls86K3WPV1Ju8TN1GzzJVLc7Z8fZ7EIvAD1DsIgjeHcIEk3b37K7mqfLlNBKUPFblHctPShlUSfY35h3z+hF+IUvOGSp0aF9oDjsdCky+yFPyXtZ1q7H6DjlnktIAY6TVRz5pbEmi7bMPgIOl8h+M1v/hHWIaTRB12BASzdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 161883359724058.509970744190014; Mon, 19 Apr 2021 04:59:57 -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-142-RbO7NPXnOC6q_mhEjUWRag-1; Mon, 19 Apr 2021 07:59:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DB608030A0; Mon, 19 Apr 2021 11:59:48 +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 BCE6560853; Mon, 19 Apr 2021 11:59:47 +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 CC4CC44A5B; Mon, 19 Apr 2021 11:59:43 +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 13JBsoFF012876 for ; Mon, 19 Apr 2021 07:54:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4A315C1D0; Mon, 19 Apr 2021 11:54:50 +0000 (UTC) Received: from work.redhat.com (ovpn-113-106.ams2.redhat.com [10.36.113.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06DE65C1C4; Mon, 19 Apr 2021 11:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618833596; 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=c/iioGriW45z3NsJAhLFkblApHM4irDlPW9FtVbK6Sg=; b=S9hf63TlTe4vh/js9Qkok6xjsseOuD+Kg4l4EhXzVFvKEJoZSuBOC7UY9I5azW6xuFWYsR nWxmqugPcU2hvCuXwKe4Mi8bSpfKBvLGDvVmN9uXDV6PnVt4RjlF9zdvUq3zay6ksj/Qsv MCEy5BQ3QI0mhQlHuWqSOFlvU4HLkhI= X-MC-Unique: RbO7NPXnOC6q_mhEjUWRag-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 5/5] virshCheckpointListCollect: Do not pass NULL to qsort Date: Mon, 19 Apr 2021 13:54:15 +0200 Message-Id: <20210419115415.19145-6-twiederh@redhat.com> In-Reply-To: <20210419115415.19145-1-twiederh@redhat.com> References: <20210419115415.19145-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.13 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Laine Stump --- tools/virsh-checkpoint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index afe849dd16..e88f9ffb47 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -628,7 +628,8 @@ virshCheckpointListCollect(vshControl *ctl, } } =20 - if (!(orig_flags & VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL)) + if (!(orig_flags & VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL) && + checkpointlist->chks) qsort(checkpointlist->chks, checkpointlist->nchks, sizeof(*checkpointlist->chks), virshChkSorter); =20 --=20 2.26.3