From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YX9Gr-0006PX-JE for qemu-devel@nongnu.org; Sun, 15 Mar 2015 10:12:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YX9Gq-0002gu-Pa for qemu-devel@nongnu.org; Sun, 15 Mar 2015 10:12:01 -0400 Sender: Paolo Bonzini Message-ID: <55059324.8030202@redhat.com> Date: Sun, 15 Mar 2015 15:11:48 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1426326454-7216-1-git-send-email-zhaoshenglong@huawei.com> <55040865.8050908@weilnetz.de> <55054F1D.2080408@redhat.com> <55055DBA.9040804@msgid.tls.msk.ru> In-Reply-To: <55055DBA.9040804@msgid.tls.msk.ru> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , Stefan Weil , Shannon Zhao , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, hangaohuai@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org On 15/03/2015 11:23, Michael Tokarev wrote: > Or, alternatively, to keep this `data' pointer in sdp to use it in > bt_l2cap_sdp_close_ch(). Yes. >> > In any case, it seems simpler to just leave this code aside. > How many times this code is called? > > We have many many places in qemu where resources are allocated once > at startup and never freed just because there's no need to. Well, in this case the bug in bt_l2cap_sdp_close_ch is much worse than a resource leak. But bluetooth is not the utmost priority in QEMU development... Paolo