Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4886303pxj; Wed, 12 May 2021 15:42:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5MxONJE1A6k0Vs0+MfstnMLLU4e08g5KQ2xsXaE7ojLNcJDM+6/1BrCbPC4IDcg0EYjHc X-Received: by 2002:a05:6808:3dc:: with SMTP id o28mr637428oie.64.1620859342104; Wed, 12 May 2021 15:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620859342; cv=none; d=google.com; s=arc-20160816; b=uk8pLIHixXD3zapgU/psRtwAlbw5JJHaQUalMOwJA6D4CTGPpbuO4wyHi/4xcR+Bpp dMilC+qEVxyGmGiuQNxwY6EBHigzt2WDsdS9CqNUAajFry9tMVNLG6P9NcmaNqMOpUr1 +YX+iIrABYVk5u80AqcIdESWGy+Nf3X86u11UWRW5t6dccXz7mmdEiy+SY9AVrJqci6s +SUyBXlZCbssyCf78+Ul1mSWhCn1wghr/p/B7rxqRxUwmqHX2XF5IxXetxpr346cr5QE ilmpMMrgUUwzdeSh1HMKM0Kox25tHE9i15TuuFFrswErZl1SNfJw0O1OQxtZ5zfUpLs9 /tqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:message-id:subject:to:from:date:dkim-signature; bh=GGtK1vER/182zGYhGgmWhvzrHE3DX7UFf32Re0ZgrBk=; b=CrzGQ0rxUlGKUVyaY7xJt2CfomHd//6VJOV0EXkoxzMK3U1ZV+rFK6f8PqwoZjHzM6 u9tc1xytovHQofPMPTu8clJ/Rnjd2xY2SMIrr/miZpCww12Y+FuTD3L1Zcx3I7k25dvD VzsRtxvw/LGVHnCSVlHwU/lbQLR/KWKlViXLym/FnDxadoy4MjqC0N2++PKCWWGYuv95 A+NIkFdNSZqYB8nVz38kMdWTik564ZXFpRmmy1flTfEK2DPJ6mah7PW8E8EeQC3eW1G8 oi02I9p6PaNlEzTJuinHlSYHhhIMYQPbdT04H+2JI1R5CEg4cd4wyMCS4JD0Q47wOA57 q0tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dmo0wUeg; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si1329067ote.289.2021.05.12.15.42.06; Wed, 12 May 2021 15:42:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dmo0wUeg; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236626AbhELWmL (ORCPT + 99 others); Wed, 12 May 2021 18:42:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53721 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238779AbhELVl5 (ORCPT ); Wed, 12 May 2021 17:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620855641; h=from:from: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; bh=GGtK1vER/182zGYhGgmWhvzrHE3DX7UFf32Re0ZgrBk=; b=Dmo0wUegUGV/LE0bDquSLRD7mSaKbkuYUFTn3/HUb6gBu6ydz77ZlOabHsgbEOtViGu5mO D/uvFMsDrFpg5v0+sh/7WnWlhWJ86u5mKPz4vrrBBo6GjfdKGYJe7mGExDc+eI35EvaNb6 p9OTigleECdaIva55wOCKIbz2bXiPyM= 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-482-p_j_LqWFMHyVskw6i75R7A-1; Wed, 12 May 2021 17:40:39 -0400 X-MC-Unique: p_j_LqWFMHyVskw6i75R7A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D4EEFC90 for ; Wed, 12 May 2021 21:40:38 +0000 (UTC) Received: from ivy-bridge (ovpn-112-130.rdu2.redhat.com [10.10.112.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C6B760CC6 for ; Wed, 12 May 2021 21:40:38 +0000 (UTC) Date: Wed, 12 May 2021 17:41:05 -0400 From: Steve Grubb To: linux-bluetooth@vger.kernel.org Subject: [Bluez PATCH 5/6] Fix leaks in src Message-ID: <20210512174105.3f3f82f2@ivy-bridge> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org g_key_file_get_string allocates memory that must be freed. asprintf allocates memory that must be freed. Signed-off-by: Steve Grubb --- src/main.c | 1 + src/shared/shell.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index c32bda7d4..94141b1e4 100644 --- a/src/main.c +++ b/src/main.c @@ -795,6 +795,7 @@ static void parse_config(GKeyFile *config) parse_br_config(config); parse_le_config(config); + g_free(str); } static void init_defaults(void) diff --git a/src/shared/shell.c b/src/shared/shell.c index c0de1640d..eed300631 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -611,6 +611,7 @@ void bt_shell_prompt_input(const char *label, const char *msg, prompt->user_data = user_data; queue_push_tail(data.prompts, prompt); + free(str); return; } -- 2.31.1