Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp641867pxj; Fri, 14 May 2021 11:54:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzvl8HeVSSkS5AUs4eD98zPQj1E6hUhwOnMf8F1t8/vnobP8PyPxhaZ8mPG2fz3GWWp0hO X-Received: by 2002:a17:906:fc0d:: with SMTP id ov13mr10191053ejb.504.1621018448484; Fri, 14 May 2021 11:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621018448; cv=none; d=google.com; s=arc-20160816; b=CHLYBue37aqbohVoGAWlAtkchmQaIxjwYp2mjni4v0BuQjxK6a4tQ7BUhWX1M9WNQC nRgyXn/N/eiXvcRG4iubgWuIKuTVKaqQO9zFaVz9w9AsxX+R4aGL3MUt8uMT0F5xaD1G KL82OhSyUk9QL2y+oCHmPCER9DIhONhPmMAbW4KoYSwzKv8YIVQFn7BRKa3IbIdRZqvK dI+Z093aDXDK18wsMrQMf16mLF3lF/aYb46IplIwnThV5BrnJe96wKxpD3BVQjPBBIkq fTBgpltgZsBVFKW03oubo2L48uT51xLQhYdroVUB2y91ip43EtqGdJ4dShVX0R6czPid xa4Q== 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=N4Y3fCMw9Zj84kXaFrDFxx83fftLWa+skQMiN44niN8=; b=DrU7ibEibLeCZYVBhP/+Lmge+eV1WrYy0lAanVH4e4g9De85950s62E1HNmQ76870e AsxDExQGq5PnZN/dje4D2dNFTH23RJHt6E9th4GMIQ8NOCkr1MW2SBySWy+VKSikAbb2 o3Cmc206ypk1qzwu0VgU0EMbwmlVVvc4huJG89DHG/fNFH+OkK5/n2ogRarJr/Z6Zc7C zbu+RRhoii/YmZSe+tLIlGhHFnuiKu5r2de6ZZThB3NLqim6hV2Upaqt1sX5W5I9N8hL pspQpwQgq1sHVlGXh8d05bEcG8ChQNWVQITX+wVc5WRXUOuhVYOl8Xk8psz9IJP8c3pA BZVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QFpxByB5; 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 o13si7452522edi.135.2021.05.14.11.53.46; Fri, 14 May 2021 11:54:08 -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=QFpxByB5; 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 S231743AbhENOAZ (ORCPT + 99 others); Fri, 14 May 2021 10:00:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53469 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbhENOAY (ORCPT ); Fri, 14 May 2021 10:00:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621000752; 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=N4Y3fCMw9Zj84kXaFrDFxx83fftLWa+skQMiN44niN8=; b=QFpxByB5R76aoFuRCvziVLr2U7cEV19hUSfEt+qOWFJ9iHiIii7pWNaDuvZ8FbJN0dGgZp vByvFe7wg2ZRD1tzr0oLtWaIp6zwhVz20SMcN+ifLCxQGEYS75eFpyCRzB0psq+FrFQWby p+IpJRfvq5CcB7sKbA9zIiFmpwbM3AE= 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-584-M82wqapjP-y9E56qHjO-rQ-1; Fri, 14 May 2021 09:59:10 -0400 X-MC-Unique: M82wqapjP-y9E56qHjO-rQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BCBD4107ACC7 for ; Fri, 14 May 2021 13:59:09 +0000 (UTC) Received: from ivy-bridge (ovpn-117-226.rdu2.redhat.com [10.10.117.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7182F19CB1 for ; Fri, 14 May 2021 13:59:09 +0000 (UTC) Date: Fri, 14 May 2021 09:59:38 -0400 From: Steve Grubb To: linux-bluetooth@vger.kernel.org Subject: [Bluez PATCH 3/6] Fix leaks in plugin Message-ID: <20210514095938.19256b85@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.11 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org g_file_get_contents allocates memory. It needs to be freed on any function exit. --- plugins/hostname.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/hostname.c b/plugins/hostname.c index f7ab9e8bc..1a9513adb 100644 --- a/plugins/hostname.c +++ b/plugins/hostname.c @@ -213,11 +213,10 @@ static void read_dmi_fallback(void) return; type = atoi(contents); + g_free(contents); if (type < 0 || type > 0x1D) return; - g_free(contents); - /* from systemd hostname chassis list */ switch (type) { case 0x3: -- 2.31.1