[dpdk-stable] [PATCH v4 1/2] lib/cmdline: release cl when cmdline exit

zhihongx.peng at intel.com zhihongx.peng at intel.com
Wed Oct 13 03:52:22 CEST 2021


From: Zhihong Peng <zhihongx.peng at intel.com>

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 at dpdk.org

Signed-off-by: Zhihong Peng <zhihongx.peng at intel.com>
---
 doc/guides/rel_notes/release_21_11.rst | 3 +++
 lib/cmdline/cmdline_socket.c           | 1 +
 2 files changed, 4 insertions(+)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index f643a61f44..2f59077709 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -226,6 +226,9 @@ API Changes
   the crypto/security operation. This field will be used to communicate
   events such as soft expiry with IPsec in lookaside mode.
 
+* cmdline: ``cmdline_stdin_exit()`` now frees the ``cmdline`` structure.
+  Calls to ``cmdline_free()`` after it need to be deleted from applications.
+
 
 ABI Changes
 -----------
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);
 }
-- 
2.25.1



More information about the stable mailing list