From nobody Sun May 19 01:42:59 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=1612950787; cv=none; d=zohomail.com; s=zohoarc; b=e6KhXkdEieC+tKGLjwvlAF8sE/EHC9sXidghyAmKJQZke5YyWoz/LK+2XQaGQysNYPIHcas3fhixEuyoSKZ4OZiZtdORB/HJbvadC9jBKIzk8MDWr6hHGdzfh9eykxJf83Et2izcfCD7uhfcqix2Qn41BSktYkJaRp8KOvfSU9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612950787; 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=NIUhclUd1eFJ9aIM5Y9RFYdH5P95GL8XKzcewZ9Ntcs=; b=lVMKGaR5zW7NDlgohuOc9YxFUX2ZuMnAL0fcBxys9WhTdYxo8lwQfS79KWY7W0cN1fvPgqW+c+R8r4qOAWqQ3gdwskZJ4x/C2Ln0dmUqLG9ApEp0IEIrCdW0nZBaXz2Ca6nH8tR+tv/kczJPJnp4NlWsJcSKWUdm1MyYZQpR+/8= 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 1612950786925232.4301760143603; Wed, 10 Feb 2021 01:53:06 -0800 (PST) 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-281-s20rxIlxPYWz23OMpt2vBg-1; Wed, 10 Feb 2021 04:53:03 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBFD5C7442; Wed, 10 Feb 2021 09:52:55 +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 16BF819C59; Wed, 10 Feb 2021 09:52:55 +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 D2D3D18095C9; Wed, 10 Feb 2021 09:52:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11A9qopJ013324 for ; Wed, 10 Feb 2021 04:52:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id EA50119CAC; Wed, 10 Feb 2021 09:52:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AC3318B42 for ; Wed, 10 Feb 2021 09:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612950785; 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=NIUhclUd1eFJ9aIM5Y9RFYdH5P95GL8XKzcewZ9Ntcs=; b=Y+ekHLbXLZTPsJmnIUReNhS8P4Wti+L9WKfJ+7kDElw9Ycb4DTe/fVu5EItcRJl5eUFy2j Un7OOT9QJqA0ccS+Ds4mNaRormHG64NE4CcHlWpDEtOsrZxijSEIxmSCCWfp5e1p21gvZi S/4pN//rQZXjVsgIoJr7SPZT0cTm4/A= X-MC-Unique: s20rxIlxPYWz23OMpt2vBg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virStorageSourceClear: Unref @vhostuser Date: Wed, 10 Feb 2021 10:52:43 +0100 Message-Id: <61713c91d7d03ab29d73eb83517f55118304af68.1612950763.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 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" The @vhostuser member of virStorageSource structure is allocated during parsing in virDomainDiskSourceVHostUserParse() but never freed leading to a memleak. Since the member is an object it has to be unrefed instead of g_free()-d. Signed-off-by: Michal Privoznik Reviewed-by: Pavel Hrdina --- src/conf/storage_source_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 7706bbd8da..67c3aedefb 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -1125,6 +1125,7 @@ virStorageSourceClear(virStorageSourcePtr def) virStorageEncryptionFree(def->encryption); virStoragePRDefFree(def->pr); virStorageSourceNVMeDefFree(def->nvme); + virObjectUnref(def->vhostuser); virStorageSourceSeclabelsClear(def); virStoragePermsFree(def->perms); VIR_FREE(def->timestamps); --=20 2.26.2