test/cmdline: fix memory leak

Message ID 20211029112315.25748-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series test/cmdline: fix memory leak |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

David Marchand Oct. 29, 2021, 11:23 a.m. UTC
  Previous change wrongly removed a valid cmdline_free().

Fixes: 6ad06203a587 ("cmdline: free on exit")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_cmdline_lib.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Olivier Matz Oct. 29, 2021, 12:13 p.m. UTC | #1
On Fri, Oct 29, 2021 at 01:23:15PM +0200, David Marchand wrote:
> Previous change wrongly removed a valid cmdline_free().
> 
> Fixes: 6ad06203a587 ("cmdline: free on exit")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

Thanks!
  
David Marchand Nov. 4, 2021, 10:08 a.m. UTC | #2
On Fri, Oct 29, 2021 at 2:13 PM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> On Fri, Oct 29, 2021 at 01:23:15PM +0200, David Marchand wrote:
> > Previous change wrongly removed a valid cmdline_free().
> >
> > Fixes: 6ad06203a587 ("cmdline: free on exit")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks.
  

Patch

diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c
index f238094b07..f50ccdb599 100644
--- a/app/test/test_cmdline_lib.c
+++ b/app/test/test_cmdline_lib.c
@@ -176,6 +176,8 @@  test_cmdline_socket_fns(void)
 		printf("Error: failed to open /dev/null for reading!");
 		return -1;
 	}
+	cmdline_free(cl);
+	cl = NULL;
 
 	/* void functions */
 	cmdline_stdin_exit(NULL);