1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-07 05:57:30 +03:00
Michal Privoznik 9636ac40a3 qemu_capabilities: Avoid memleak in virQEMUCapsProbeFullDeprecatedProperties()
As one of its arguments, the
virQEMUCapsProbeFullDeprecatedProperties() gets a pointer to
GStrv (a string list), which it may eventually replace. It's
single caller (virQEMUCapsProbeQMPHostCPU()) passes a string list
indeed. Now, when replacing one string list with another plain
g_free() is not enough as we need to free individual strings too.

==13573== 34 bytes in 8 blocks are definitely lost in loss record 271 of 576
==13573==    at 0x4844878: malloc (vg_replace_malloc.c:446)
==13573==    by 0x51789D1: g_malloc (in /usr/lib64/libglib-2.0.so.0.7800.6)
==13573==    by 0x5193E82: g_strdup (in /usr/lib64/libglib-2.0.so.0.7800.6)
==13573==    by 0x4997F73: g_strdup_inline (gstrfuncs.h:321)
==13573==    by 0x4997F73: virJSONValueArrayToStringList (virjson.c:1296)
==13573==    by 0x5027CF7: qemuMonitorJSONParseCPUModelExpansion (qemu_monitor_json.c:5139)
==13573==    by 0x50281C9: qemuMonitorJSONGetCPUModelExpansion (qemu_monitor_json.c:5245)
==13573==    by 0x501044F: qemuMonitorGetCPUModelExpansion (qemu_monitor.c:3261)
==13573==    by 0x4F190D0: virQEMUCapsProbeQMPHostCPU (qemu_capabilities.c:3227)
==13573==    by 0x4F2145E: virQEMUCapsInitQMPMonitor (qemu_capabilities.c:5758)
==13573==    by 0x10FFF8: testQemuCaps (qemucapabilitiestest.c:111)
==13573==    by 0x110B53: virTestRun (testutils.c:143)
==13573==    by 0x11063E: doCapsTest (qemucapabilitiestest.c:200)

Fixes: 51c098347d7f2af9b4386ac0adc4431997d06f3d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2024-12-19 09:14:53 +01:00
2019-05-31 17:54:28 +02:00
2024-11-12 11:00:26 +01:00
2024-11-30 23:38:37 +01:00
2019-09-06 12:47:46 +02:00
2022-03-17 14:33:12 +01:00
2023-12-05 11:48:28 +01:00
2020-08-03 09:26:48 +02:00
2019-10-18 17:32:52 +02:00
2015-06-16 13:46:20 +02:00
2024-09-24 08:24:00 +02:00
2024-12-02 13:20:38 +01:00

.. image:: https://gitlab.com/libvirt/libvirt/badges/master/pipeline.svg
     :target: https://gitlab.com/libvirt/libvirt/pipelines
     :alt: GitLab CI Build Status
.. image:: https://bestpractices.coreinfrastructure.org/projects/355/badge
     :target: https://bestpractices.coreinfrastructure.org/projects/355
     :alt: CII Best Practices
.. image:: https://translate.fedoraproject.org/widgets/libvirt/-/libvirt/svg-badge.svg
     :target: https://translate.fedoraproject.org/engage/libvirt/
     :alt: Translation status

==============================
Libvirt API for virtualization
==============================

Libvirt provides a portable, long term stable C API for managing the
virtualization technologies provided by many operating systems. It
includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware
vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER
Hypervisor.

For some of these hypervisors, it provides a stateful management
daemon which runs on the virtualization host allowing access to the
API both by non-privileged local users and remote users.

Layered packages provide bindings of the libvirt C API into other
languages including Python, Perl, PHP, Go, Java, OCaml, as well as
mappings into object systems such as GObject, CIM and SNMP.

Further information about the libvirt project can be found on the
website:

https://libvirt.org


License
=======

The libvirt C API is distributed under the terms of GNU Lesser General
Public License, version 2.1 (or later). Some parts of the code that are
not part of the C library may have the more restrictive GNU General
Public License, version 2.0 (or later). See the files ``COPYING.LESSER``
and ``COPYING`` for full license terms & conditions.


Installation
============

Instructions on building and installing libvirt can be found on the website:

https://libvirt.org/compiling.html

Contributing
============

The libvirt project welcomes contributions in many ways. For most components
the best way to contribute is to send patches to the primary development
mailing list. Further guidance on this can be found on the website:

https://libvirt.org/contribute.html


Contact
=======

The libvirt project has two primary mailing lists:

* users@lists.libvirt.org (**for user discussions**)
* devel@lists.libvirt.org (**for development only**)

Further details on contacting the project are available on the website:

https://libvirt.org/contact.html
Description
Libvirt native C API and daemons
Readme 675 MiB
Languages
C 94.8%
Python 2%
Meson 0.9%
Shell 0.8%
Dockerfile 0.6%
Other 0.8%