Re: [PATCH 1/9] util: json: Fix freeing of objects appended to virJSONValue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 30, 2018 at 12:59:08PM +0200, Peter Krempa wrote:
It was not possible to determine whether virJSONValueObjectAddVArgs and
the functions using it would consume a virJSONValue or not when used
with the 'a' or 'A' modifier depending on when the loop failed.

Fix this by passing in a pointer to the pointer so that it can be
cleared once it's successfully consumed and the callers don't have to
second-guess leaving a chance of leaking or double freeing the value
depending on the ordering.

Fix all callers to pass a double pointer too.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
src/qemu/qemu_agent.c        |  7 ++-----
src/qemu/qemu_block.c        | 22 ++++++----------------
src/qemu/qemu_command.c      |  2 +-
src/qemu/qemu_monitor_json.c | 36 ++++++++++--------------------------
src/util/virjson.c           | 10 +++++++---
tests/qemublocktest.c        |  4 +---
6 files changed, 27 insertions(+), 54 deletions(-)


ACK

Jano

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux