From patchwork Fri Aug 14 09:54:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chengbo <515672508@qq.com> X-Patchwork-Id: 11714083 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B210B739 for ; Fri, 14 Aug 2020 09:54:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3D82204EA for ; Fri, 14 Aug 2020 09:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgHNJyi (ORCPT ); Fri, 14 Aug 2020 05:54:38 -0400 Received: from lucky1.263xmail.com ([211.157.147.131]:36114 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbgHNJyi (ORCPT ); Fri, 14 Aug 2020 05:54:38 -0400 Received: from localhost (unknown [192.168.167.70]) by lucky1.263xmail.com (Postfix) with ESMTP id A2048B0AAE for ; Fri, 14 Aug 2020 17:54:34 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED: 0 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [113.57.152.160]) by smtp.263.net (postfix) whith ESMTP id P26754T139821989230336S1597398873569370_; Fri, 14 Aug 2020 17:54:34 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: chengbo@uniontech.com X-SENDER: chengbo@uniontech.com X-LOGIN-NAME: chengbo@uniontech.com X-FST-TO: linux-bluetooth@vger.kernel.org X-SENDER-IP: 113.57.152.160 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: chengbo <515672508@qq.com> To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] adapt:Set property mode failed,memory leak This patch will fix a memory leak,when set property mode,it will send a msg, but if failed,the data'memory do not free Date: Fri, 14 Aug 2020 17:54:33 +0800 Message-Id: <20200814095433.10654-1-515672508@qq.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- src/adapter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/adapter.c b/src/adapter.c index 5e896a9f0..cb4cd8b75 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2918,6 +2918,7 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting, if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param, property_set_mode_complete, data, g_free) > 0) + g_free(data); return; g_free(data);