Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4893639pxj; Wed, 12 May 2021 15:55:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnb2a7BXunb/cVuPKkONw+mszTnVSjYxLUQGX+1Grma69jzCtHJA+rkmOpTSoIbMOgaERf X-Received: by 2002:a17:906:80cd:: with SMTP id a13mr39886637ejx.109.1620860154945; Wed, 12 May 2021 15:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620860154; cv=none; d=google.com; s=arc-20160816; b=Xa0919TiKybdY6AAxErFtTGdjNqQIuwDeJbp6kCjO/cIA9c6BYARSwF3+a9vANppto uX27HZHcv9hPA0ObS+GyovsphvXV/vPE9HwRoRb/TXQKdIuwVANuQwaNzCIa6slOoZ0e 4b3z1gY3jM6hBX/j3Yo05d/ZfHWkq0YNipt5WhQAfltDBwWJnJqFMvycUwdy0DsI9fEc X9QdmDQZxKpCQpFn+HJq3KHJrd9R/MYNcnluSmuLjNHIyinDtxBPXBO8bSyuuiVYh4aG seMvwbMBJbUvbAhAUFo01IneUGe60Rypjb6hnPl0/oSLoPzSFstgjHp2ctSAEFlUbX+2 339g== 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=ZjFysPE72wEn02XDNwKNZXqJiKo5jA+rqapk3/wuO3M=; b=fq/Kh7T638K2s+AAOR6ROygVBm8nVcjppPIY0mpqR4noqNTG18qHoujW/VxAtcTXL+ c79KD+f/0B7ytqQFIIB4NI87Ss+WmC6ZRq8v3P+iTepfax1mNb//oWKU1MkD2U60bHw1 9Avy8v6a1pjIJZji2Qx68UGyBtLUP+UF+Qyiz8Izj6/Kh++EROuuYw7KT7gBl8B2qbdZ oM5kz7hI9rOTNb4lClVrhLBveGpDF2HcXxBp6tLjNEZSvzZP7LuhW//AbAm+oqDS26zF 8rA+QnBXOM6FMtBsNJvKZw2wW2JmbIcv3SrcUxf2iz+JdofxaLLL3BTgMYrrTuJK+WS/ mpGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=duGiZcS1; 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 cx8si850765edb.100.2021.05.12.15.55.31; Wed, 12 May 2021 15:55:54 -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=duGiZcS1; 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 S233420AbhELWln (ORCPT + 99 others); Wed, 12 May 2021 18:41:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41036 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392467AbhELVhr (ORCPT ); Wed, 12 May 2021 17:37:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620855399; 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=ZjFysPE72wEn02XDNwKNZXqJiKo5jA+rqapk3/wuO3M=; b=duGiZcS1jSiE6iYGhdQzXGjGlDPHG9NVOXm63wyS/6kwPOnucsvxbJPY+0mbJa/bb0nnUV SvoLNwo+WpDi11Set8IyeG9dyST5elJ1VjKVxjWYflpznP8dB1uWw8m2lb0eQ7V8Ovmk9I AFDCyKQB5Kha7LeThGzUInpWAzN0zKo= 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-352-kBP6iXCWNvGspiPVhgejHw-1; Wed, 12 May 2021 17:36:35 -0400 X-MC-Unique: kBP6iXCWNvGspiPVhgejHw-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 B25A41020C37 for ; Wed, 12 May 2021 21:36:34 +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 5E68750AC6 for ; Wed, 12 May 2021 21:36:34 +0000 (UTC) Date: Wed, 12 May 2021 17:37:01 -0400 From: Steve Grubb To: linux-bluetooth@vger.kernel.org Subject: [Bluez PATCH 3/6] Fix leaks in plugin Message-ID: <20210512173701.4bd04817@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. Signed-off-by: Steve Grubb --- 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