From: Xu Wang <[email protected]>

Signed-off-by: Xu Wang <[email protected]>
---
 libxkutil/device_parsing.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index 56e39c7..6cdcfa9 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -79,6 +79,28 @@ static void cleanup_device_address(struct device_address 
*addr)
         addr->ct = 0;
 }
 
+static void cleanup_node_of_others(struct others *others)
+{
+        if (others == NULL)
+                return;
+
+        free(others->name);
+        free(others->parent_name);
+        free(others->value);
+        free(others);
+}
+
+static void cleanup_others(struct others *others)
+{
+        struct others *head = others;
+
+        while (others) {
+                head = others->next;
+                cleanup_node_of_others(others);
+                others = head;
+        }
+}
+
 static void cleanup_disk_device(struct disk_device *dev)
 {
         if (dev == NULL)
-- 
1.8.3.1

_______________________________________________
Libvirt-cim mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvirt-cim

Reply via email to