]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virnetdaemon: fix memory leak in virNetDaemonCallInhibit
authorPavel Hrdina <phrdina@redhat.com>
Wed, 23 Sep 2020 14:31:21 +0000 (16:31 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 23 Sep 2020 14:45:50 +0000 (16:45 +0200)
commitd20268178175cea7d86d19e370dc70e72905fc14
tree2e7d1d81239c55c3ffe5b0f766e791fb89949770
parent784f204e7ef13be3249ab1f816ee90a1f8a77ae0
virnetdaemon: fix memory leak in virNetDaemonCallInhibit

g_variant_new() returns a weak reference which can be consumed by passing
to other g_variant* functions or to g_dbus_connection_call* functions.

This make it possible to call g_variant_new() directly as argument to
the functions above. Because this might be confusing I explicitly call
g_variant_ref_sink() to make it normal reference in both
virGDBusCallMethod() and virGDBusCallMethodWithFD() so the caller is
always responsible for the data.

Reported-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/rpc/virnetdaemon.c