From: "Daniel P. Berrange" <berrange(a)redhat.com>
The fetch_list helper cleanup code iterates over the
elements in 'lst' array free'ing each one. This is dead
code, however, since the only way to get there is from
codepaths which do not populate 'lst' elements.
This fixes two coverity DEADCODE reports
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
libvirt-gobject/libvirt-gobject-connection.c | 6 +-----
libvirt-gobject/libvirt-gobject-storage-pool.c | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-connection.c
b/libvirt-gobject/libvirt-gobject-connection.c
index 5c8eb16..687a185 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -719,11 +719,7 @@ static gchar ** fetch_list(virConnectPtr vconn,
return lst;
error:
- if (lst != NULL) {
- for (i = 0 ; i < n; i++)
- g_free(lst[i]);
- g_free(lst);
- }
+ g_free(lst);
return NULL;
}
diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c
b/libvirt-gobject/libvirt-gobject-storage-pool.c
index e02adc8..aa27872 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.c
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
@@ -347,11 +347,7 @@ static gchar ** fetch_list(virStoragePoolPtr vpool,
return lst;
error:
- if (lst != NULL) {
- for (i = 0 ; i < n; i++)
- g_free(lst[i]);
- g_free(lst);
- }
+ g_free(lst);
return NULL;
}
--
1.8.3.1