From nobody Fri Apr 26 04:05:16 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=1617809408; cv=none; d=zohomail.com; s=zohoarc; b=Z8kG4sdg/69WX/jcL6cTLqFcmTNepAXkHHd4JzK3OLi+LKaPU59hQacl7MSKjycnubn0IC5EVMS7mBE7e/aAEsGrStrQAugNyNcnPkhRrt0q3FXwb4fOHk03GvJRNG+oKMjNyELbotKu151oQvCvtipuFNRHgnWHb0aTIhPeTGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617809408; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=bOttHiDIT8rAjVBDZYNBuN4dbzDlgP9KszkBqC1KMx8=; b=QEHkex19ATTjZh0qYv4sgiroO6c6ueoKnUzKe+YtzU3jED7ni9LfbBVqQ45u52P0s8wTPAksCxtQnbj9CHNoBrNt7SwAfQR5g4ukB9QFZMcZniPMIfM91vYUDb2My9JDfn2z1sjqsnZAvgDNmZby+imjV2gH2BbZh4LExzUTU/g= 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 1617809408422489.07483097896454; Wed, 7 Apr 2021 08:30:08 -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-147-XcNbPMDwMT-WKMhHlfluqQ-1; Wed, 07 Apr 2021 11:30:03 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76F5F84B99E; Wed, 7 Apr 2021 15:29:57 +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 3FF135B4B6; Wed, 7 Apr 2021 15:29: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 2999F1806D0E; Wed, 7 Apr 2021 15:29:55 +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 137FTrWn003261 for ; Wed, 7 Apr 2021 11:29:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70EA65D6CF; Wed, 7 Apr 2021 15:29:53 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id E18C078EB7 for ; Wed, 7 Apr 2021 15:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617809406; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bOttHiDIT8rAjVBDZYNBuN4dbzDlgP9KszkBqC1KMx8=; b=XrpfJplIPxvtxnzpSo0Z78y3sRWAlpf6inE40QReFA1A7FWcmqnE4KqWUMzBZUpHCu1dse Zp3wDegcuXDM7cnWpQZTCeIlViKUtmjz6hAdwPTIRdFuupKPyR1esPfyBuGaBKTwYVuKzs tOQyQmHHbLEntvDS5SqFn2m1dBpWy9A= X-MC-Unique: XcNbPMDwMT-WKMhHlfluqQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH] vsh: fix memory leak in vshCommandParse Date: Wed, 7 Apr 2021 17:29:50 +0200 Message-Id: <6a38a1c01dc5993600f9e8dba2d2819bc7578545.1617809308.git.jtomko@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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) One of the error branches used a plain free where vshCommandFree was required. https://bugzilla.redhat.com/show_bug.cgi?id=3D1943415 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- tools/vsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 552ed29ab9..d9c0a9b80d 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -1530,7 +1530,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *pa= rser, vshCmd **partial) =20 if (!partial && vshCommandCheckOpts(ctl, c, opts_required, opts_seen) < 0)= { - VIR_FREE(c); + vshCommandFree(c); goto syntaxError; } =20 --=20 2.29.2