From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 AC6A281741 for ; Mon, 29 Apr 2024 15:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406048; cv=none; b=IjVEbJ4M0pKZBNz8KzqBzTJGU8vnYjmkQN4MlpJRLGgmVRQotKgEqKNU66KlHKMIahaUFqzZ3KbW5srHFUQGgQUKQjNW3m/838EVGW2ZucrA96d6lN50wGoUoFFOOt+Joik0m4hlN94CgRVoUg165u0amPWebZyVFady8ukVUG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406048; c=relaxed/simple; bh=3tMffTlWqYOLrBeShO5Vw6pzAWYKcBMjzLueCWRTp70=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=L3cEjQXo8CrWqDPyvibb2/wCOGPA9ph65S/XKvMELkaHJyWewn8PHlonhcXuWvtFLyI24Y62YVmYdrvJKpiXRaZ66skqh4qlNNh67z7MaMPTC79fiPH9HwmsOaivCKhryVrvom2YaLjx4/9h9VbbR2pvmErPS3lo7MkD74X9Wb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=InaVhfaI; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="InaVhfaI" Message-ID: <19952499-cebe-4e77-b830-d0a666cde651@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714406043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3tMffTlWqYOLrBeShO5Vw6pzAWYKcBMjzLueCWRTp70=; b=InaVhfaIK0qTVZejddevfW0119rTt2RItxwT1O86a3+cJsJXhzGVgdQLGSy5DUOR2ySjlI I+16Lik24Q17NaX4ZRqtMc9cneQCRKKKJlkLNSO4xsr55JPiFe5yWFk90IdLN86wuvMdw2 yKagq/qvQcm5hb6PsZILr561ZW7lqjk= Date: Mon, 29 Apr 2024 08:53:55 -0700 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: Free strdup memory in veristat Content-Language: en-GB To: Geliang Tang , Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Jakub Sitnicki Cc: Geliang Tang , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 4/29/24 12:07 AM, Geliang Tang wrote: > From: Geliang Tang > > The strdup() function returns a pointer to a new string which is a > duplicate of the string "input". Memory for the new string is obtained > with malloc(), and need to be freed with free(). > > This patch adds these missing "free(input)" in parse_stats() to avoid > memory leak in veristat.c. > > Signed-off-by: Geliang Tang Acked-by: Yonghong Song