Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4892997pxj; Wed, 12 May 2021 15:54:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCVx9qfeJQi5KTz0dVKRtI7lFGTw7n/vfcs/IWVD25rQcGibQ0Y20Dmk7hI9iJ4KPN6Xux X-Received: by 2002:a17:906:7f8e:: with SMTP id f14mr22969097ejr.510.1620860087343; Wed, 12 May 2021 15:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620860087; cv=none; d=google.com; s=arc-20160816; b=ipdr/SodjC6ZqYnLWCAesFnQVR/wym37AhSerOG5qCGz0Zs55r8aTxmSw8DShFe1hT +visVxuHeWnptXIOiZGOD3NuBboQdHnmuX+u8dQ7TBQK2FgDNFiBjbe2n3sgUT+z0Bqn iqlmCSK3nQDQNQIw4+iQOXvgUKVTW4PxqvnMVDTMYSHPhju2fA7fwgUUwbPiBVbzSkQs pgG6CxVPIHvYpAuuPbIpIGdcUs3kNpNM3Pc4Arh7bpWkxMLAyLdUOekMQQOsl9zLeIjp bGsRMYdGN9JmVCcNSERVm2SfOLiJsasVGnQ2vux4v/EseTyR4bV4ItZT5xPnLd5QWjUQ lkJQ== 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=9EmV1kN1gTkpksgYyw/F2byguyMpsEcJHlN8hTupe2E=; b=NCfo39ZBe2N9T6bU1MFNqvu3/sHb8tmjYkG+FuBwYoZpdw2YAnahz/OQhnSY5WV7Jx 1rELY8vUlCUT1bG02VJJRxKirAVwCeZ9koL1VUBE8Rg7KvMOqyLsH9gVNFOTNsFcSmBM hHL05C5GTrSqBtW2CpLCM49cPpJXiy5n8CEwDxrnIPo7Y/y7Vwbp491aUtaCyOa9nxLy dqrIQFGB6YMWQX8vNRlJsWY2iCo7mvJqZGR+gD54jw6bDJwNnZ4KHrz/heNUmgttMihi lK/HGnoL8xr2X3McdpTwg/z521AKXNVMyPk4r4zCinm0CWNwr9U4S3HFru5sZnW2UPKd s4Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YwMiho5+; 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 g16si1228914ejr.663.2021.05.12.15.53.59; Wed, 12 May 2021 15:54:47 -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=YwMiho5+; 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 S238891AbhELWmC (ORCPT + 99 others); Wed, 12 May 2021 18:42:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22002 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbhELVij (ORCPT ); Wed, 12 May 2021 17:38:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620855445; 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=9EmV1kN1gTkpksgYyw/F2byguyMpsEcJHlN8hTupe2E=; b=YwMiho5+mBBliBs5cntj9aJK1XzVVi9PNqvV1lqjnnzy+rZuNC725R0sNhg7Dx8a4XrRiO NW71CQZoaL4JeHKeO9r9PlkSUaFkg+O2H+LnPYXO/8T8Y9zWPdZJDcZR1mBGFZaOIDQwx3 gyVPlJYz2ovaZabgbxcmJQAuWclWa8k= 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-294-FYOhXDsbOQW-fAkoMUC04w-1; Wed, 12 May 2021 17:37:24 -0400 X-MC-Unique: FYOhXDsbOQW-fAkoMUC04w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75586107ACF2 for ; Wed, 12 May 2021 21:37:23 +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 29D546086F for ; Wed, 12 May 2021 21:37:23 +0000 (UTC) Date: Wed, 12 May 2021 17:37:50 -0400 From: Steve Grubb To: linux-bluetooth@vger.kernel.org Subject: [Bluez PATCH 4/6] Fix leaks in profiles Message-ID: <20210512173750.63ef39a5@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.13 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org g_new0 allocates memory that must be freed Signed-off-by: Steve Grubb --- profiles/audio/avrcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index c6a342ee3..58d30b24d 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -3508,8 +3508,10 @@ static struct avrcp_player *create_ct_player(struct avrcp *session, path = device_get_path(session->dev); mp = media_player_controller_create(path, id); - if (mp == NULL) + if (mp == NULL) { + g_free(player); return NULL; + } media_player_set_callbacks(mp, &ct_cbs, player); player->user_data = mp; -- 2.31.1