From nobody Mon Feb 9 03:29:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1674466326; cv=none; d=zohomail.com; s=zohoarc; b=boQ2R8J5Op2IWvnLKE7XFEwaE+40wTf5PqjvOCFcxuxtjdxV6R6xey659H3zxPo9gWUwOwb6xkD6z0ifV+JbFSIGmgnW9JnCKhEx927migHI8JnDukZZN6yaEFn/W+6d2/88mxflsUn0UrPnKg+dsXUIAjEkaHRzLuc2LNr7hSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674466326; 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=C0ktpnlsU7JrXL7tPueZcvk4oMl4x/LPwWpozyuPFNk=; b=oHdAa+ICW7qsF1MTh8c826dDBEq457WbwEf+ZtiOHDGuhjgXRKN/cO0ExXGaZ3366zFZuk3vuL+o+P2PxzO7crdDJNVWv1rSo49WGxWFd9xJNhZk3noHWNqbVNmQotYkM+Ao4Ir31jXJkvnDm/4aLMsErqEFypqa6h0TaW5hrNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 167446632661264.65022384463532; Mon, 23 Jan 2023 01:32:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-471-0a9kiqJJP1CzGmlRfJfU5g-1; Mon, 23 Jan 2023 04:32:00 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E2ADB882822; Mon, 23 Jan 2023 09:31:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A03212026FFF; Mon, 23 Jan 2023 09:31:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7E187194658D; Mon, 23 Jan 2023 09:31:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 656461946589 for ; Mon, 23 Jan 2023 09:31:55 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 594BA40C2005; Mon, 23 Jan 2023 09:31:55 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0137240C2004 for ; Mon, 23 Jan 2023 09:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674466325; 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=C0ktpnlsU7JrXL7tPueZcvk4oMl4x/LPwWpozyuPFNk=; b=hTut2ucys4nnQ3oon2ZSkTdkbIrABmYLpxaeTNOc/bIQ/JWAau4PMuGp6smmhVvQjC4qBL Vw5gRfxM5ei+ONshl70XfXFCJPQfBjB2OOHilSc32Tzm8KI5IuKAS3wFraOZXhYr/8F3P/ 6rU9IkpD05RLV04mAxF4RscNFL6r9Jg= X-MC-Unique: 0a9kiqJJP1CzGmlRfJfU5g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] vbox: Fix memleak in _virtualboxCreateMachine() Date: Mon, 23 Jan 2023 10:31:52 +0100 Message-Id: <499253d3e7c8d2bb882e87b63a47d34e64e1c938.1674466269.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674466328079100003 Content-Type: text/plain; charset="utf-8"; x-default="true" The _virtualboxCreateMachine() function allocates @createFlagsUtf16 but never frees it. =3D=3D12481=3D=3D 236 bytes in 2 blocks are definitely lost in loss record = 2,060 of 2,216 =3D=3D12481=3D=3D at 0x48407E5: malloc (vg_replace_malloc.c:393) =3D=3D12481=3D=3D by 0xB6C6D1B: RTStrToUtf16Tag (utf-8.cpp:1033) =3D=3D12481=3D=3D by 0xB4DB500: _virtualboxCreateMachine (vbox_tmpl.c:63= 4) =3D=3D12481=3D=3D by 0xB4E68A3: vboxDomainDefineXMLFlags (vbox_common.c:= 1976) =3D=3D12481=3D=3D by 0x4C7DF83: virDomainDefineXMLFlags (libvirt-domain.= c:6666) =3D=3D12481=3D=3D by 0x13C2DA: remoteDispatchDomainDefineXMLFlags (remot= e_daemon_dispatch_stubs.h:5271) =3D=3D12481=3D=3D by 0x13C265: remoteDispatchDomainDefineXMLFlagsHelper = (remote_daemon_dispatch_stubs.h:5252) =3D=3D12481=3D=3D by 0x4AD9DF7: virNetServerProgramDispatchCall (virnets= erverprogram.c:428) =3D=3D12481=3D=3D by 0x4AD9931: virNetServerProgramDispatch (virnetserve= rprogram.c:302) =3D=3D12481=3D=3D by 0x4AE28AC: virNetServerProcessMsg (virnetserver.c:1= 35) =3D=3D12481=3D=3D by 0x4AE2972: virNetServerHandleJob (virnetserver.c:15= 5) =3D=3D12481=3D=3D by 0x49BC275: virThreadPoolWorker (virthreadpool.c:164) Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/vbox/vbox_tmpl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 52b1c93b6d..91609741e3 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -626,6 +626,7 @@ _virtualboxCreateMachine(struct _vboxDriver *data, virD= omainDef *def, IMachine * machine); VIR_FREE(createFlags); VBOX_UTF16_FREE(machineNameUtf16); + VBOX_UTF16_FREE(createFlagsUtf16); vboxIIDUnalloc(&iid); return rc; } --=20 2.39.1