[PATCH 0/5] alloc: Don't mask use of uninitialized variables in VIR_FREE

Ján Tomko jtomko at redhat.com
Thu Mar 5 12:25:55 UTC 2020


On a Thursday in 2020, Peter Krempa wrote:
>Neither GCC nor clang report warnings if pointer passed to VIR_FREE is
>uninitialized. This is probably caused by our internal implementation
>which mangles the pointer to it.
>
>Fix all offenders and replace VIR_FREE's internals with g_clear_pointer.
>
>Peter Krempa (5):
>  virNetworkPortDefSaveStatus: Fix potentially uninitialized 'path' by
>    refactoring cleanup
>  virLXCProcessSetupNamespaceName: Fix potential uninitialized free of
>    'path'
>  cmdDomHostname: Fix uninitialized use of 'hostname' by refactoring
>    cleanup
>  testQemuMonitorJSONqemuMonitorJSONGetTargetArch: Fix uninitialized use
>    of 'arch'
>  VIR_ALLOC: Replace internals by g_clear_pointer
>
> src/conf/virnetworkportdef.c | 19 +++++++------------
> src/libvirt_private.syms     |  1 -
> src/lxc/lxc_process.c        |  3 +--
> src/util/viralloc.c          | 21 ++-------------------
> src/util/viralloc.h          |  7 +------
> tests/qemumonitorjsontest.c  | 14 +++++---------
> tools/virsh-domain.c         | 18 ++++++------------
> 7 files changed, 22 insertions(+), 61 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200305/1449f25f/attachment-0001.sig>


More information about the libvir-list mailing list