From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 171837046649328.556414869975924; Fri, 14 Jun 2024 06:07:46 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 44B5711ED; Fri, 14 Jun 2024 09:07:45 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id ADBAD1263; Fri, 14 Jun 2024 09:07:12 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 17EFAA6E; Fri, 14 Jun 2024 09:07:09 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A4E4BE96 for ; Fri, 14 Jun 2024 09:07:08 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-w6IUH4vCNZK7BcDT7jcMmw-1; Fri, 14 Jun 2024 09:07:06 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E60DD195608E for ; Fri, 14 Jun 2024 13:07:05 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.3.102]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0BCC319560AD for ; Fri, 14 Jun 2024 13:07:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718370428; h=from:from: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; bh=SrnIiZqfbs4hTMVOtmngIvbyml5Z8Ne9lLAtAvItRsA=; b=UFu271FbDhyBOj9FRbzVdyFUJ1jEUwB8wQ9lAB5G7qGpxJVi6njZ/XFZ9AqrkLC3XUJDeg 5LcE7zWbT93ax7h4cRIJWcg0cpyKFEDk1tbuzxwVvM2G1pzBlUM5SvCjuclOOzSdvNAD9A 7pghYnSFuEtesDf6Hqj6NUO/AGcNoUI= X-MC-Unique: w6IUH4vCNZK7BcDT7jcMmw-1 From: Michal Privoznik To: devel@lists.libvirt.org Subject: [PATCH 1/3] virfirewall: Fir a memleak in virFirewallParseXML() Date: Fri, 14 Jun 2024 15:06:59 +0200 Message-ID: <2391b69ca807843d30ea65ad9c9720fbf830f7d6.1718370189.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GATHBMF63BLKU4OW7VPUBL47MR3D7AG5 X-Message-ID-Hash: GATHBMF63BLKU4OW7VPUBL47MR3D7AG5 X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1718370468225100001 Content-Type: text/plain; charset="utf-8"; x-default="true" As a part of parsing XML, virFirewallParseXML() calls virXMLNodeContentString() and then passes the return value further. But virXMLNodeContentString() is documented so that it's the caller's responsibility to free the returned string, which virFirewallParseXML() never does. This leads to a memory leak: 14,300 bytes in 220 blocks are definitely lost in loss record 1,879 of 1,= 891 at 0x4841858: malloc (vg_replace_malloc.c:442) by 0x5491E3C: xmlBufCreateSize (in /usr/lib64/libxml2.so.2.12.6) by 0x54C2401: xmlNodeGetContent (in /usr/lib64/libxml2.so.2.12.6) by 0x49F7791: virXMLNodeContentString (virxml.c:354) by 0x4979F25: virFirewallParseXML (virfirewall.c:1134) by 0x4ABEB1E: virNetworkLoadState (virnetworkobj.c:938) by 0x4ABF35C: virNetworkObjLoadAllState (virnetworkobj.c:1072) by 0x4E9A25E: networkStateInitialize (bridge_driver.c:624) by 0x4CB1FA6: virStateInitialize (libvirt.c:665) by 0x15A6C6: daemonRunStateInit (remote_daemon.c:611) by 0x49E69F0: virThreadHelper (virthread.c:256) by 0x532B428: start_thread (in /lib64/libc.so.6) Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/util/virfirewall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 2219506b18..ae81ca52c6 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -1131,7 +1131,7 @@ virFirewallParseXML(virFirewall **firewall, NULL, NULL, NULL); for (i =3D 0; i < nargs; i++) { =20 - char *arg =3D virXMLNodeContentString(argsNodes[i]); + g_autofree char *arg =3D virXMLNodeContentString(argsNodes= [i]); if (!arg) return -1; =20 --=20 2.44.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1718370487871203.58662465180294; Fri, 14 Jun 2024 06:08:07 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8151D10F5; Fri, 14 Jun 2024 09:08:06 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8A54711E0; Fri, 14 Jun 2024 09:07:14 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4C7A91080; Fri, 14 Jun 2024 09:07:10 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id DA0B2E96 for ; Fri, 14 Jun 2024 09:07:09 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518--9OwCilYN_qrvN0IbXQodA-1; Fri, 14 Jun 2024 09:07:07 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB91019560A7 for ; Fri, 14 Jun 2024 13:07:06 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.3.102]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 31ECA19560AA for ; Fri, 14 Jun 2024 13:07:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718370429; h=from:from: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; bh=Tl7VU5GPsiWPXu3hIe6uMFcqjhHtfJVJmc+TVYGCHbo=; b=f4gAM7sNSI4ZmOSfdauaVeS7gG4j+3WGKCDCuZVxk+eKe4Ucqt3PTANQwUDMwUdhdJQdPk xvDhwTz02CMByhGAycOvSa2Ge0wZlcxVSOB17PeYw7ZfEDRMBdISzqHilo9fcSqyxYGI2S t16ifZarPUbPKD15TDc/3HIOyLX0B4U= X-MC-Unique: -9OwCilYN_qrvN0IbXQodA-1 From: Michal Privoznik To: devel@lists.libvirt.org Subject: [PATCH 2/3] virnetworkobj: Free fwRemoval before setting another one in virNetworkObjSetFwRemoval() Date: Fri, 14 Jun 2024 15:07:00 +0200 Message-ID: <1ff5099b2c15d328a178c4c7dec996c33f6e7a53.1718370189.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ITSVOAGG7474K3N4JCFHJZOMOETWAMK7 X-Message-ID-Hash: ITSVOAGG7474K3N4JCFHJZOMOETWAMK7 X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1718370488329100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The virNetworkObjSetFwRemoval() function is called at least two times when there's a network running and network driver initializes: 1) when loading state XMLs: #0 virNetworkObjSetFwRemoval (obj=3D0x7fffd4028250, fwRemoval=3D0x7fffd4= 020ad0) at ../src/conf/virnetworkobj.c:258 #1 0x00007ffff7a69c68 in virNetworkLoadState (...) at ../src/conf/virnet= workobj.c:952 #2 0x00007ffff7a6a35d in virNetworkObjLoadAllState (...) at ../src/conf/= virnetworkobj.c:1072 #3 0x00007ffff7f9625f in networkStateInitialize (...) at ../src/network/= bridge_driver.c:624 2) when firewall rules are being reloaded: #0 virNetworkObjSetFwRemoval (obj=3D0x7fffd4028250, fwRemoval=3D0x7fffd4= 02e5b0) at ../src/conf/virnetworkobj.c:258 #1 0x00007ffff7f997b4 in networkReloadFirewallRulesHelper (obj=3D0x7fffd= 4028250, opaque=3D0x0) at ../src/network/bridge_driver.c:1703 #2 0x00007ffff7a6b09b in virNetworkObjListForEachHelper (payload=3D0x7ff= fd4028250, ...) at ../src/conf/virnetworkobj.c:1414 #3 0x00007ffff79287b6 in virHashForEachSafe (...) at ../src/util/virhash= .c:387 #4 0x00007ffff7a6b119 in virNetworkObjListForEach (...) at ../src/conf/v= irnetworkobj.c:1441 #5 0x00007ffff7f99978 in networkReloadFirewallRules (...) at ../src/netw= ork/bridge_driver.c:1742 #6 0x00007ffff7f962f2 in networkStateInitialize (...) at ../src/network/= bridge_driver.c:645 Since virNetworkObjSetFwRemoval() does not free the object stored in the first call, the second call just overwrites the stored pointer leading to a memory leak: 5,530 (48 direct, 5,482 indirect) bytes in 1 blocks are definitely lost i= n loss record 1,863 of 1,880 at 0x4848C43: calloc (vg_replace_malloc.c:1595) by 0x4F1E979: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.7800.6) by 0x4976E32: virFirewallNew (virfirewall.c:118) by 0x4979BA9: virFirewallParseXML (virfirewall.c:1071) by 0x4ABEB1E: virNetworkLoadState (virnetworkobj.c:938) by 0x4ABF35C: virNetworkObjLoadAllState (virnetworkobj.c:1072) by 0x4E9A25E: networkStateInitialize (bridge_driver.c:624) by 0x4CB1FA6: virStateInitialize (libvirt.c:665) by 0x15A6C6: daemonRunStateInit (remote_daemon.c:611) by 0x49E69F0: virThreadHelper (virthread.c:256) by 0x532B428: start_thread (in /lib64/libc.so.6) by 0x5397373: clone (in /lib64/libc.so.6) Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/virnetworkobj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 19305798cb..5abc295506 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -255,6 +255,7 @@ void virNetworkObjSetFwRemoval(virNetworkObj *obj, virFirewall *fwRemoval) { + virFirewallFree(obj->fwRemoval); obj->fwRemoval =3D fwRemoval; /* give it a name so it's identifiable in the XML */ if (fwRemoval) --=20 2.44.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1718370511436262.5500979205676; Fri, 14 Jun 2024 06:08:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 538D811A9; Fri, 14 Jun 2024 09:08:30 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8B8811123; Fri, 14 Jun 2024 09:07:20 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8FBA01238; Fri, 14 Jun 2024 09:07:16 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 753A21209 for ; Fri, 14 Jun 2024 09:07:11 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-263-_wgiWMjSNEO0oQeblxbavw-1; Fri, 14 Jun 2024 09:07:09 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FD3A195608E for ; Fri, 14 Jun 2024 13:07:08 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.3.102]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6015319560AA for ; Fri, 14 Jun 2024 13:07:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718370431; h=from:from: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; bh=4+n8icvYvLvqIbiykazdohBFjJlVG9b9EVR8zkFm5dk=; b=fjinShe5GHOAkY8cGF9Inrmr2uP3i01xaf6j4vd6O29EJ5hAUuTPqDiamEe5OdBZy1JPBT eUZMwiBGvK2fcfTECnS8zQwFUJByox96jmBViPf7jxoxYjRFBNZdFZ64FKyS+XcW7bREKV rInJeY8X6GUMtw2tJjUWgKWHy1BvSE0= X-MC-Unique: _wgiWMjSNEO0oQeblxbavw-1 From: Michal Privoznik To: devel@lists.libvirt.org Subject: [PATCH 3/3] remote_daemon_dispatch: Unref sasl session when closing client connection Date: Fri, 14 Jun 2024 15:07:01 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5SW64HDRV4HTOXNJYXX26EQWGXJPNITC X-Message-ID-Hash: 5SW64HDRV4HTOXNJYXX26EQWGXJPNITC X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1718370512449100001 Content-Type: text/plain; charset="utf-8"; x-default="true" In ideal world, where clients close connection gracefully their SASL session is freed in virNetServerClientDispose() as it's stored in client->sasl. Unfortunately, if client connection is closed prematurely (e.g. the moment virsh asks for credentials), the _virNetServerClient member is never set and corresponding SASL session is never freed. The handler is still stored in client private data, so free it in remoteClientCloseFunc(). 20,862 (288 direct, 20,574 indirect) bytes in 3 blocks are definitely los= t in loss record 1,763 of 1,772 at 0x50390C4: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.= 0.7800.6) by 0x501BDAF: g_object_new_internal.part.0 (in /usr/lib64/libgobject-2= .0.so.0.7800.6) by 0x501D43D: g_object_new_with_properties (in /usr/lib64/libgobject-2= .0.so.0.7800.6) by 0x501E318: g_object_new (in /usr/lib64/libgobject-2.0.so.0.7800.6) by 0x49BAA63: virObjectNew (virobject.c:252) by 0x49BABC6: virObjectLockableNew (virobject.c:274) by 0x4B0526C: virNetSASLSessionNewServer (virnetsaslcontext.c:230) by 0x18EEFC: remoteDispatchAuthSaslInit (remote_daemon_dispatch.c:3696) by 0x15E128: remoteDispatchAuthSaslInitHelper (remote_daemon_dispatch_= stubs.h:74) by 0x4B0FA5E: virNetServerProgramDispatchCall (virnetserverprogram.c:4= 23) by 0x4B0F591: virNetServerProgramDispatch (virnetserverprogram.c:299) by 0x4B18AE3: virNetServerProcessMsg (virnetserver.c:135) Signed-off-by: Michal Privoznik --- src/remote/remote_daemon_dispatch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index cfc1067e40..c88c9f5b15 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1776,6 +1776,10 @@ static void remoteClientCloseFunc(virNetServerClient= *client) daemonRemoveAllClientStreams(priv->streams); =20 remoteClientFreePrivateCallbacks(priv); + +#if WITH_SASL + virObjectUnref(priv->sasl); +#endif } =20 =20 --=20 2.44.2