From nobody Sun Feb 8 21:48:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1578471530; cv=none; d=zohomail.com; s=zohoarc; b=hBP4TUrfuyB6RL4CTHcnMioRmIEZgvWY+y+ypMQzy/too3V+cRETK/h83OvUs41cWDiOpQ0iySuymYlRkP0Cj8WOBC9rypuPJKp9UxkgppcHOBc4zIJLuuIg88PuNgldQ41ThcIrpLWSg1ezBlStjC6E9obK7oV3ACKgN3ypqTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578471530; 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=JTzcSxAo0JLuI5TcnwcWoHnJxzhEewcpEq4PNJ001S4=; b=OumMlWMpSrUokQiopwHUShRuPYqiWRejCfYa1EiPt80cmCELzXj2LQzoqoecIDH8vWqQCv4hzSaYc2ldgZnuNX6GEuBwlQ9kstY1NedhprbGGfNEF+W9uj9tPnriGFrxRFDZa3yOcSlKwnFTj3GdD0YJK9YSZ//khqP2DAxTSFk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1578471530218871.0588984207218; Wed, 8 Jan 2020 00:18:50 -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-203-5xBSo_K7M92g0hR9gmS6rQ-1; Wed, 08 Jan 2020 03:18:47 -0500 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 9E9C9800A02; Wed, 8 Jan 2020 08:18:41 +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 3882B10013A7; Wed, 8 Jan 2020 08:18:41 +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 6350E81C9E; Wed, 8 Jan 2020 08:18:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0088IcvP008251 for ; Wed, 8 Jan 2020 03:18:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2F64A60CD1; Wed, 8 Jan 2020 08:18:38 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC30760CC0 for ; Wed, 8 Jan 2020 08:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578471529; 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=JTzcSxAo0JLuI5TcnwcWoHnJxzhEewcpEq4PNJ001S4=; b=URTlsSsV92K1XqrgKG4X0vLTLVD+fIHermMzeM7DAgqbwT6GfpJf58iYDgfglUMdn9dqD3 Zd/exWRXHXP2o1AlYR8MpKHGPSv+KednkRaJhqtBAqdYG9RDqOrb6pA2EZQRqpUJ0pzryY yGHEy5Nvrx9S6D5bTdWlFNuVQHC98wc= From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 8 Jan 2020 09:18:29 +0100 Message-Id: <45c362bcfa30f515f6fcd60085b041291e2a49f9.1578471437.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] virchrdev: Don't leak @dev member of virChrdevHashEntry struct 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 X-MC-Unique: 5xBSo_K7M92g0hR9gmS6rQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When opening a console to a domain, we put a tuple of {path, virStreamPtr} into a hash table that's private to the domain. This is to ensure only one client at most has the console stream open. Later, when the console is closed, the tuple is removed from the hash table and freed. Except, @path won't be freed. =3D=3D234102=3D=3D 60 bytes in 5 blocks are definitely lost in loss record = 436 of 651 =3D=3D234102=3D=3D at 0x4836753: malloc (vg_replace_malloc.c:307) =3D=3D234102=3D=3D by 0x5549110: g_malloc (in /usr/lib64/libglib-2.0.so.= 0.6000.6) =3D=3D234102=3D=3D by 0x5562D1E: g_strdup (in /usr/lib64/libglib-2.0.so.= 0.6000.6) =3D=3D234102=3D=3D by 0x4A5A917: virChrdevOpen (virchrdev.c:412) =3D=3D234102=3D=3D by 0x17B64645: qemuDomainOpenConsole (qemu_driver.c:1= 7309) =3D=3D234102=3D=3D by 0x4BC8031: virDomainOpenConsole (libvirt-domain.c:= 9662) =3D=3D234102=3D=3D by 0x13F854: remoteDispatchDomainOpenConsole (remote_= daemon_dispatch_stubs.h:9211) =3D=3D234102=3D=3D by 0x13F72F: remoteDispatchDomainOpenConsoleHelper (r= emote_daemon_dispatch_stubs.h:9178) =3D=3D234102=3D=3D by 0x4AB0685: virNetServerProgramDispatchCall (virnet= serverprogram.c:430) =3D=3D234102=3D=3D by 0x4AB01F0: virNetServerProgramDispatch (virnetserv= erprogram.c:302) =3D=3D234102=3D=3D by 0x4AB700B: virNetServerProcessMsg (virnetserver.c:= 136) =3D=3D234102=3D=3D by 0x4AB70CB: virNetServerHandleJob (virnetserver.c:1= 53) Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/conf/virchrdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index d4ca3188c5..7657c41ece 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -225,6 +225,7 @@ static void virChrdevHashEntryFree(void *data) /* delete lock file */ virChrdevLockFileRemove(ent->dev); =20 + g_free(ent->dev); g_free(ent); } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list