]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedevmdevctltest: Fix two memleaks
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 26 Feb 2024 11:42:09 +0000 (12:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 26 Feb 2024 13:35:52 +0000 (14:35 +0100)
commitb3a67644c3c8cae4cc80eea05dc0cddd745b9e99
tree5c04a8a04ea5b4ed6b3755537f94a21140ddc388
parent3ab5f63f6eea4fce2b705b4ff548fd570dc2ba3e
nodedevmdevctltest: Fix two memleaks

There are two memleaks inside of nodedevmdevctltest:

1) In the testCommandDryRunCallback() - when appending lines to
   stdinbuf the pointer is overwritten without freeing the old
   memory it pointed to.

2) In testMdevctlModify() the livecmd variable is reused and
   since its marked as g_autoptr() the first use leaks.

Fixes: 582f27ff15f14fa0e913278c0a2ca9840c3f12f5
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tests/nodedevmdevctltest.c