Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp451945lqo; Fri, 10 May 2024 05:14:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQPKg0P2kC3rzO2Yhu7Ry/W6iEhnLqdk/mgcWrvdwe2+EmklFghN+agwN2FwAt90rw/YE2dIoRYV4o25zMvBkpOZXA32gKKi7e52vehA== X-Google-Smtp-Source: AGHT+IGak9lUk4UB5WkOuMYGUrvnK0/2qzOY0BSR9YOi29vDFMdgH+rTHyBozP/eq3WrDrUiSCk5 X-Received: by 2002:a50:cd42:0:b0:570:5b71:4859 with SMTP id 4fb4d7f45d1cf-5734d704dc8mr1669013a12.41.1715343287987; Fri, 10 May 2024 05:14:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715343287; cv=pass; d=google.com; s=arc-20160816; b=lI7Z63TFquLlQ490hNG9fX/kkaPalckxY30BP/xoWagFSNwv1Hqg6W4Gjo3RXBy7JJ csmZ+Kf7k2eGNhaBF/hsqURpKjv5/hZ/rTh6lN+v3je/iL68Y8g4QCSftdOIkY4xAA/K pA87N5Txr1lS4UHv/s6WE22yxAH2cQOAPM1VI/merMb4DI0MWgBFJfJa7Qotgn3lfypZ e21ht2vUYkXtqEkl04aAAGyLpEzlbxEe7YzlJg9iHX5GtgSNnYO+4f599iZXT80OYvAo GahdyC076p8VoXekTW4yURCd0QkXUEeO0strEmGt6+3iOsWC2t2TDOmPnFtRMJacw+Mr l+Qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=hNhoLqqzogug6O1gn3HAIOb86MmK9ncIM4dYBFffVGc=; fh=uo5u2TQK/HQlhydMwGLjBAnuDwaLxndJ/cgWTjIagS8=; b=rfV/XO9omK1Ixmjd+pILRrsCYVULkx98p2DI9yHmTJVf1Et4WeKnLMA2tDmGimFeZI s1om2F7hemraaPJJ+16EzrxGrrn1etUXOFHLtr45MkfCe1DS//ntqoWLbKnEUjGRP7AS W1a5NSr1ZjbKY3YGUdp11KtLGlu0nCq4aEi+IHGmug1uTmsgvXIQR5npbddW+ylY3HCu qnwn1nus5Xqt6p/3C44iEy918JOHezD5gaQgew5Dui4aSBid7va36TL73vt35thekzmY 15hr/I19y06saae09gERfcIi9kN6uqwq+QzBzSdTVIWeEo5BO7qgCV2gF3UsHaei4Yeg Ta6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4475-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d458fsi1885537a12.342.2024.05.10.05.14.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 05:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4475-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9C3231F2323C for ; Fri, 10 May 2024 12:14:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A87211708AC; Fri, 10 May 2024 12:14:17 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 650B716F267 for ; Fri, 10 May 2024 12:14:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715343257; cv=none; b=NeTxyJ6B+V9ZEZy5Htx31kbzc9Hg7GT/L3hDN9DfMaIPgbrNu+2HjfmJEBy9I86J2ScKg3sBT1JIoxcrWBTLXp9kyj0knvtHg6rN5d/iIwPTPK/AEa3B/7j4FDIoNyOhDDUQxLUe4QtZSFegk+OcvGpMxopKvdNKFs1/IckvGSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715343257; c=relaxed/simple; bh=F9aBXHTyJ8yCD7egItUeFRNE5MgkR7fAK7lVYebRWgM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S8I+AAGNAFcZGoffWyO64kUgN/EszFM4JOiR5tatHGo+D7wB+3bsBxoBayxsdgKbSICLeDTtfhjNGj4O6mvlx7N1AlM+M6INNQcFA8EEfQxivkYsB5RI4hNNaEXir0elf9wf8kUnvqyZBh1ywnYDTSBu2RcPywT7dMKIfWNxJ4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hadess.net; spf=pass smtp.mailfrom=hadess.net; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hadess.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hadess.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 75ED46000F; Fri, 10 May 2024 12:13:57 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Cc: Bastien Nocera Subject: [BlueZ v2 06/20] client/main: Fix mismatched free Date: Fri, 10 May 2024 14:10:16 +0200 Message-ID: <20240510121355.3241456-7-hadess@hadess.net> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240510121355.3241456-1-hadess@hadess.net> References: <20240510121355.3241456-1-hadess@hadess.net> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: hadess@hadess.net Error: ALLOC_FREE_MISMATCH (CWE-762): [#def37] bluez-5.75/client/main.c:2108:2: alloc: Allocation of memory which must be freed using "g_free". bluez-5.75/client/main.c:2108:2: assign: Assigning: "desc" = "g_strdup_printf("\x1b[0;94m[%s]\x1b[0m# ", attr)". bluez-5.75/client/main.c:2111:2: free: Calling "free" frees "desc" using "free" but it should have been freed using "g_free". 2109| 2110| bt_shell_set_prompt(desc); 2111|-> free(desc); 2112| } 2113| --- client/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.c b/client/main.c index f703cc91b24a..f967c149e7bd 100644 --- a/client/main.c +++ b/client/main.c @@ -2113,7 +2113,7 @@ static void set_default_local_attribute(char *attr) desc = g_strdup_printf(COLOR_BLUE "[%s]" COLOR_OFF "# ", attr); bt_shell_set_prompt(desc); - free(desc); + g_free(desc); } static void cmd_select_attribute(int argc, char *argv[]) -- 2.44.0