]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: monitor: Fix a memory leak in qemuMonitorJSONAttachCharDevCommand
authorErik Skultety <eskultet@redhat.com>
Tue, 13 Jun 2017 15:55:36 +0000 (17:55 +0200)
committerErik Skultety <eskultet@redhat.com>
Wed, 14 Jun 2017 08:46:02 +0000 (10:46 +0200)
commitbb12db16b41032cf7c6001a4d0e7ee20720c93a0
tree22fed6745952685c71bc245adf4e30325ec69fc5
parent992bf863fccfe1fa1d0c5a5277b9cee50abc48ef
qemu: monitor: Fix a memory leak in qemuMonitorJSONAttachCharDevCommand

With the current logic, we only free @tlsalias as part of the error
label and would have to free it explicitly earlier in the code. Convert
the error label to cleanup, so that we have only one sink, where we
handle all frees. Since JSON object append operation consumes pointers,
make sure @backend is cleared before we hit the cleanup label.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_monitor_json.c