From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1468A0C55; Tue, 31 Aug 2021 19:52:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C4904013F; Tue, 31 Aug 2021 19:52:28 +0200 (CEST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mails.dpdk.org (Postfix) with ESMTP id EF76640041; Tue, 31 Aug 2021 19:52:26 +0200 (CEST) Received: by mail-lj1-f181.google.com with SMTP id h1so88249ljl.9; Tue, 31 Aug 2021 10:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7BThsE7ee/FGBBeLk1ddKV8bxqEeMBxB6om4Y4FpkGM=; b=NWu3guDwlGwZE/Ah2gSbGh1IIbb8DQWxg6Ne0y3TiTN9jhToUnBOsf6eqdD+7wmTkS NMGh4Hq6Nnp2tW90s4ME6Y+v3+LvqHeBUqzuar3GW19BKc6yVUeqsdtAL/rkeSkE1Udg 1l/gow4qiePFeM906s8LezjrDu5ueTbNoT9M92Bx6KcwDzc2MSrYyTJ/jtlZYU+aBruV /bPi4AsBFGnwfc9CMYjsaYocXZ1+6a7yTmk49sMuPpIhS2O5Th3ZOEVBCITilP8M+p9H otlwhCqhG7lTjb/9Gi6RRPL8F7OKnk/xqyir/zUC5qF2cxhvPTn2NSBtzwYO/GYtwtgg oRBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7BThsE7ee/FGBBeLk1ddKV8bxqEeMBxB6om4Y4FpkGM=; b=GysrQuK+h+cV7+E3n85L6MtsiOtyZ7uGvFQw2Q9jDtISbdHiZS5Lm29x16nvCYXHXh aqZfM87M81+yhmdNOwAsuydFQnhIE7Pgjsi+4pHgbO0FfqskueZJXmjanQDxZQsYoF47 ZGOiZ6bt+E4K78fDSlKpHWO1HT4435P2Kejlq4dr+mNObvZJUdFkUCaJmwxuwVTCUF+R j0XMfnGMo4pkt/LP7gjnkL7Obnqi7MTr6NTO9fxwGv815zcP4IM1vqTgRvbuo+hYwalI kJ2QQcfq0mfHUp3H416vCSFj0OEm9a/pXFPJHTYIbQVcki0HCXejM8U4e9rybJccGfBU 7lIg== X-Gm-Message-State: AOAM533DUspBKdRT8Bs0uZdwMa0jYLcVAH9OSKxFn/rO7jZjPFqxnBgl YaFV+9+vWXU1gzRYbGrv/u8= X-Google-Smtp-Source: ABdhPJxvTbyMAugeQgLuWRwqMdqANYxNZQ0XOLVZM7KinyeGufHqLFvqAgJH+cRemNbliZDIBFWc8w== X-Received: by 2002:a2e:4a19:: with SMTP id x25mr3038560lja.235.1630432346439; Tue, 31 Aug 2021 10:52:26 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t8sm2193954ljg.103.2021.08.31.10.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 10:52:25 -0700 (PDT) Date: Tue, 31 Aug 2021 20:52:24 +0300 From: Dmitry Kozlyuk To: zhihongx.peng@intel.com Cc: olivier.matz@6wind.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20210831205224.14ddb447@sovereign> In-Reply-To: <20210831022844.18057-1-zhihongx.peng@intel.com> References: <20210831022844.18057-1-zhihongx.peng@intel.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2021-08-31 10:28 (UTC+0800), zhihongx.peng@intel.com: > From: Zhihong Peng > > Malloc cl in the cmdline_stdin_new function, so release in the > cmdline_stdin_exit function is logical, so that cl will not be > released alone. > > Fixes: af75078fece3 (first public release) > Cc: stable@dpdk.org > > Signed-off-by: Zhihong Peng > --- > lib/cmdline/cmdline_socket.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/cmdline/cmdline_socket.c b/lib/cmdline/cmdline_socket.c > index 998e8ade25..ebd5343754 100644 > --- a/lib/cmdline/cmdline_socket.c > +++ b/lib/cmdline/cmdline_socket.c > @@ -53,4 +53,5 @@ cmdline_stdin_exit(struct cmdline *cl) > return; > > terminal_restore(cl); > + cmdline_free(cl); > } Now cmdline_free() may not be called after cmdline_stdin_exit(). User code that does so needs to be changed to avoid double-free. This behavior change must be documented in the release notes. I'm not sure it should be backported because of the above.