| Message ID | 20260416023021.626949-21-sjg@u-boot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306680; bh=Ztab/QuSIQgiG+dYLES4lTfiTnHzOJXp/5+iwpVLMeQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=onrNl06kYGDlLn0Olvq6D0frEMjAsnWM3MOo8sfF73E2V7Kmj5XpAKSnQdWFppNl2 kmUEv2PrBgfJ1uNy70E07DMS4P5j6Re4MGVOME4hrGvv3FIWw+U6ZqwT6Cp/Ft90fp ES6OKsBJ7MpJu48WAX1eM60+GXpswbdg1CItIwUE= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 870656A4A0 for <u-boot-concept@u-boot.org>; Wed, 15 Apr 2026 20:31:20 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gbWUkjYdhwgO for <u-boot-concept@u-boot.org>; Wed, 15 Apr 2026 20:31:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306677; bh=Ztab/QuSIQgiG+dYLES4lTfiTnHzOJXp/5+iwpVLMeQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Yt1nKY9WF/y/scCZgtUq5Y0la0wErintc9RWkOIiti89yzBx8+GbtFNujWi0y6fT/ QtqH5A3jnxuNufoS6jLL1elgc2AMVxJT1bzQsBAoL3NSTaSPb/NHeye4Hg7ku1AUN4 U2tmkIViKx57uaRDbJQ0D9oAzjnqcvOmh1weAw1M= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 91B9B6A4CC for <u-boot-concept@u-boot.org>; Wed, 15 Apr 2026 20:31:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306675; bh=iF6/gDhFqu4A5omEUhs1dkVxpNZQ+JuAEBtm+o4pRGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNyvfKuSd6K8VMVUxxi1XUGQmbwxoEe44lYgNcAqjr4MjtACgQ8WCn7SAkMzDPbtI otowxLXIKFFopl74HsKEvQJz1OWm83efFfTlsx9VsOZ6UvaNdIZPI2Qpf/+IEzP1Um QALOx12/MM2T0WFfpVozbGP9zf7xbR3jArCCaXtA= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 844B16A4CC; Wed, 15 Apr 2026 20:31:15 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 7T5UIzmccneG; Wed, 15 Apr 2026 20:31:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306668; bh=hlMKOV8Znkye7p2ZYwiZuGDKb0efSAxZ/BEUXXSPg9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6qr9ru259LNlV36bm/ydFvvX2BCVstaYF6G2PiA4UUJHxNuwHmgzsFjWYk+S86hQ yHuVnztCrFqiaG5Og6ZAuulhjp9NXimOsOlkkV3BG71R72/x4XWu99b6cExzgIh2tf 7UHwi5ScdO2259i/4xOEzgrsmUvNn2dUsIrSn2YE= Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 95E986A4BC; Wed, 15 Apr 2026 20:31:08 -0600 (MDT) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Wed, 15 Apr 2026 20:29:45 -0600 Message-ID: <20260416023021.626949-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260416023021.626949-1-sjg@u-boot.org> References: <20260416023021.626949-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5FZZ5G35NASO4SPEK3RF5HSIOH5KZQ4L X-Message-ID-Hash: 5FZZ5G35NASO4SPEK3RF5HSIOH5KZQ4L X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass <sjg@chromium.org> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/33] boot: Replace the current cedit expo on reload List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/5FZZ5G35NASO4SPEK3RF5HSIOH5KZQ4L/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
Fix memory leaks and test pollution in sandbox tests
|
|
Commit Message
Simon Glass
April 16, 2026, 2:29 a.m. UTC
From: Simon Glass <sjg@chromium.org> The 'cedit load' command builds a new expo and stashes the pointer in cur_exp, overwriting any previous one without freeing it. When 'cedit run' is successful, the expo is destroyed, but on failure (or when a test inspects cur_exp and never calls 'cedit run' again) the previous expo lingers and leaks every scene, string and object it owns, about 20 KB per cedit test. Destroy any current expo before replacing it on reload. Signed-off-by: Simon Glass <sjg@chromium.org> --- cmd/cedit.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/cmd/cedit.c b/cmd/cedit.c index fc477291be8..bcd75fdb771 100644 --- a/cmd/cedit.c +++ b/cmd/cedit.c @@ -62,6 +62,8 @@ static int do_cedit_load(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; } + if (cur_exp) + expo_destroy(cur_exp); cur_exp = exp; return 0;