Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1105871ybi; Wed, 3 Jul 2019 09:34:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7/+R7pFJrXcLNzN88h9472xZq3K9snZ7fbPWIIq+ZMZEq+rWgXiQAKwkdyNXqbF9+PbnZ X-Received: by 2002:a17:902:7c90:: with SMTP id y16mr44084027pll.238.1562171695449; Wed, 03 Jul 2019 09:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562171695; cv=none; d=google.com; s=arc-20160816; b=YOsgGfnzMfr6OjslkmkXXIop7j+DR/BcYREty5tcAtWw2QnRa7hCpuIYY10K0allH8 YT3zxoJHwEl9I9HWrSUjfPgAIjIqbMSlH3l99nsu9SFyIRvAI3QnFu49Y/sqy58afYp1 GoKrO9G+Dty0a76STqXmqUoB0fLzoWC3evcB/T9A2MIu3OX1DXEOwEUnTukItjunUMWL L/90BpekdGJAlVfP2tYbLxSE2mGQiOANjOMj0nTQO0N51sWw1v6Idr3gdNku9izAjFLP H8QuGwGVEtyBlM1yZvTTrOQibyw396EeW+7WqcKiZj2frAHNsQKprSJlj01L9/uPwDOB 5duA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=+LLWcKGeTPCXLdpg4NDvn1ffSUvQRxGEmQX0NjoBxoU=; b=sGSMuBEogG9GrQUWvY0eNygdNVRJZ/0SDHNZylTF+A1slBg8YxSggvG5eLgLmWvqTV LBUDtLm/PsjknumYu6syh+JCP4HMhgBIhwIt91fGICPuVUfTlhAp2GJkkgv0Wj7BC07t 8wLzShO1vZhNHhzZeHk6bScXPoIB3a7E/EZSSR/GDNV9eowarbtkUTkZRV/9srWEHdw9 08KWgV0ZZXPv3JkIB6hRQmoMMiczR45H8EKHQu3uOf/U9hm0Aq5k8yEmohhOSWk6wC67 y+IXJ9giQzCFQYinBwA2MmxcIe68YoKzFeuiFjJQo7buqfBb4ImBWiWCF3PTwY/edojT gfFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 200si2812774pfy.101.2019.07.03.09.34.29; Wed, 03 Jul 2019 09:34:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbfGCQeR (ORCPT + 99 others); Wed, 3 Jul 2019 12:34:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:49908 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbfGCQeQ (ORCPT ); Wed, 3 Jul 2019 12:34:16 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2019 09:34:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,446,1557212400"; d="scan'208";a="158031234" Received: from bgix-dell-lap.sea.intel.com ([10.254.20.71]) by orsmga008.jf.intel.com with ESMTP; 03 Jul 2019 09:34:14 -0700 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: inga.stotland@intel.com, brian.gix@intel.com, michal.lowas-rzechonek@silvair.com Subject: [PATCH BlueZ] mesh: Fix memory leak on dbus message creation Date: Wed, 3 Jul 2019 09:34:03 -0700 Message-Id: <20190703163403.15814-1-brian.gix@intel.com> X-Mailer: git-send-email 2.14.5 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- mesh/model.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesh/model.c b/mesh/model.c index 7401dcecb..a2b3e5c18 100644 --- a/mesh/model.c +++ b/mesh/model.c @@ -729,10 +729,13 @@ static void send_msg_rcvd(struct mesh_node *node, uint8_t ele_idx, bool is_sub, if (!l_dbus_message_builder_finalize(builder)) goto error; + l_dbus_message_builder_destroy(builder); l_dbus_send(dbus, msg); + return; error: l_dbus_message_builder_destroy(builder); + l_dbus_message_unref(msg); } bool mesh_model_rx(struct mesh_node *node, bool szmict, uint32_t seq0, -- 2.14.5