Hello community,

here is the log from the commit of package libvirt-cim for openSUSE:Factory 
checked in at 2018-01-10 23:35:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libvirt-cim (Old)
 and      /work/SRC/openSUSE:Factory/.libvirt-cim.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libvirt-cim"

Wed Jan 10 23:35:22 2018 rev:46 rq:562882 version:0.6.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/libvirt-cim/libvirt-cim.changes  2014-12-03 
22:48:05.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libvirt-cim.new/libvirt-cim.changes     
2018-01-10 23:35:31.942997555 +0100
@@ -1,0 +2,7 @@
+Mon Jan  8 09:35:28 UTC 2018 - [email protected]
+
+- f6b7eeaf.patch: backport memory leak fix
+- memory_leaks.patch: fix asprintf related memory leaks
+  (bnc#1002028)
+
+-------------------------------------------------------------------

New:
----
  f6b7eeaf.patch
  memory_leaks.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libvirt-cim.spec ++++++
--- /var/tmp/diff_new_pack.vSfH79/_old  2018-01-10 23:35:34.286887578 +0100
+++ /var/tmp/diff_new_pack.vSfH79/_new  2018-01-10 23:35:34.290887390 +0100
@@ -35,6 +35,8 @@
 Patch0:         provider-reg.patch
 Patch1:         automake.patch
 Patch2:         libvirt-cim-0.6.3-fix-bashisms.patch
+Patch3:         f6b7eeaf.patch
+Patch4:         memory_leaks.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  automake
 BuildRequires:  autoconf
@@ -89,6 +91,8 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 chmod -x src/* libxkutil/* schema/* README doc/* base_schema/README*
 chmod +X src/* libxkutil/* schema/*
 

++++++ f6b7eeaf.patch ++++++
Ported by: Adam Majer <[email protected]>
Date: Tue Jan  9 09:57:22 CET 2018

commit f6b7eeaf097b6441ed7928c7130582a83bba5f7d
Author: Viktor Mihajlovski <[email protected]>
Date:   Fri Sep 6 14:09:55 2013 +0200

    libxkutil: Plug memory leaks in device parsing
    
    Fixed a number of memory leaks detected while running xml_parse_test
    under valgrind.
    
    Signed-off-by: Viktor Mihajlovski <[email protected]>
    Reviewed-by: Boris Fiuczynski <[email protected]>

Index: libvirt-cim-0.6.3/libxkutil/device_parsing.c
===================================================================
--- libvirt-cim-0.6.3.orig/libxkutil/device_parsing.c
+++ libvirt-cim-0.6.3/libxkutil/device_parsing.c
@@ -94,6 +94,8 @@ static void cleanup_net_device(struct ne
         free(dev->device);
         free(dev->net_mode);
         free(dev->filter_ref);
+        free(dev->poolid);
+        cleanup_vsi_device(&dev->vsi);
 }
 
 static void cleanup_emu_device(struct emu_device *dev)
@@ -594,6 +596,7 @@ static int parse_mem_device(xmlNode *nod
         struct virt_device *vdev = NULL;
         struct mem_device *mdev = NULL;
         char *content = NULL;
+        int ret = 0;
 
         vdev = calloc(1, sizeof(*vdev));
         if (vdev == NULL)
@@ -608,17 +611,15 @@ static int parse_mem_device(xmlNode *nod
         else if (XSTREQ(node->name, "memory"))
                 sscanf(content, "%" PRIu64, &mdev->maxsize);
 
-        free(content);
-
         *vdevs = vdev;
-
-        return 1;
+        vdev = NULL;
+        ret = 1;
 
  err:
         free(content);
         free(vdev);
 
-        return 0;
+        return ret;
 }
 
 static char *get_attr_value_default(xmlNode *node, char *attrname,
@@ -806,7 +807,10 @@ static int do_parse(xmlNodeSet *nsv, dev
         }
 
   out:
-        *l = list;
+        if (list) {
+                free(*l);
+                *l = list;
+        }
         return lstidx;
 }
 
@@ -1159,7 +1163,7 @@ static int parse_features(struct domain
 
 static void set_action(int *val, xmlNode *child)
 {
-        const char *action = (char *)xmlNodeGetContent(child);
+        char *action = (char *)xmlNodeGetContent(child);
 
         if (action == NULL)
                 *val = CIM_VSSD_RECOVERY_NONE;
@@ -1171,6 +1175,8 @@ static void set_action(int *val, xmlNode
                 *val = CIM_VSSD_RECOVERY_RESTART;
         else
                 *val = CIM_VSSD_RECOVERY_NONE;
+
+        xmlFree(action);
 }
 
 static int parse_domain(xmlNodeSet *nsv, struct domain *dominfo)
@@ -1318,9 +1324,11 @@ void cleanup_dominfo(struct domain **dom
 
         dom = *dominfo;
         free(dom->name);
+        free(dom->typestr);
         free(dom->uuid);
         free(dom->bootloader);
         free(dom->bootloader_args);
+        free(dom->clock);
 
         if (dom->type == DOMAIN_XENPV) {
                 free(dom->os_info.pv.type);
@@ -1345,6 +1353,7 @@ void cleanup_dominfo(struct domain **dom
                 CU_DEBUG("Unknown domain type %i", dom->type);
         }
 
+        cleanup_virt_devices(&dom->dev_emu, 1);
         cleanup_virt_devices(&dom->dev_mem, dom->dev_mem_ct);
         cleanup_virt_devices(&dom->dev_net, dom->dev_net_ct);
         cleanup_virt_devices(&dom->dev_disk, dom->dev_disk_ct);
++++++ memory_leaks.patch ++++++
Author: Adam Majer <[email protected]>
Date: Thu Dec  7 15:10:07 CET 2017

Other asprintf memory leaks found. Forwarded upstream.

Index: libvirt-cim-0.6.3/src/Virt_ComputerSystem.c
===================================================================
--- libvirt-cim-0.6.3.orig/src/Virt_ComputerSystem.c
+++ libvirt-cim-0.6.3/src/Virt_ComputerSystem.c
@@ -417,6 +417,8 @@ static int set_other_id_info(const CMPIB
                                     CMPI_string);
         }
 
+        free (model);
+
         CMSetProperty(instance, "OtherIdentifyingInfo",
                       &id_info, CMPI_stringA);
 
Index: libvirt-cim-0.6.3/src/Virt_SettingsDefineCapabilities.c
===================================================================
--- libvirt-cim-0.6.3.orig/src/Virt_SettingsDefineCapabilities.c
+++ libvirt-cim-0.6.3/src/Virt_SettingsDefineCapabilities.c
@@ -1977,7 +1977,6 @@ static CMPIStatus set_input_props(const
         char *cap;
 
         if (get_input_dev_caption(type, bus, &cap) != 1) {
-                free(cap);
                 cu_statusf(_BROKER, &s,
                            CMPI_RC_ERR_NOT_FOUND,
                            "Unable to build input caption");
@@ -1985,12 +1984,15 @@ static CMPIStatus set_input_props(const
         }
 
         if (caption != NULL) {
-                if (asprintf(&cap, "%s %s", caption, cap) == -1) {
+                char *old_cap = cap;
+                if (asprintf(&cap, "%s %s", caption, old_cap) == -1) {
+                        free(old_cap);
                         cu_statusf(_BROKER, &s,
                                    CMPI_RC_ERR_NOT_FOUND,
                                    "Unable to build input caption");
                         goto out;
                 }
+                free(old_cap);
         }
 
         inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_INPUT, DEVICE_RASD);

Reply via email to