[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix freeing of records, when the given pointer is NULL.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID de00775e39dafcf1fc34166417274a24b9c4ce17
# Parent  0db0c19d338683fe08dd77054e1b7692e81b2190
Fix freeing of records, when the given pointer is NULL.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/src/xen_host.c     |    4 ++++
 tools/libxen/src/xen_host_cpu.c |    4 ++++
 tools/libxen/src/xen_network.c  |    4 ++++
 tools/libxen/src/xen_pif.c      |    4 ++++
 tools/libxen/src/xen_sr.c       |    4 ++++
 tools/libxen/src/xen_user.c     |    4 ++++
 tools/libxen/src/xen_vbd.c      |    4 ++++
 tools/libxen/src/xen_vdi.c      |    4 ++++
 tools/libxen/src/xen_vif.c      |    4 ++++
 tools/libxen/src/xen_vm.c       |    4 ++++
 tools/libxen/src/xen_vtpm.c     |    4 ++++
 11 files changed, 44 insertions(+)

diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_host.c
--- a/tools/libxen/src/xen_host.c       Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_host.c       Sat Oct 28 11:54:05 2006 +0100
@@ -76,6 +76,10 @@ void
 void
 xen_host_record_free(xen_host_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name_label);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_host_cpu.c
--- a/tools/libxen/src/xen_host_cpu.c   Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_host_cpu.c   Sat Oct 28 11:54:05 2006 +0100
@@ -78,6 +78,10 @@ void
 void
 xen_host_cpu_record_free(xen_host_cpu_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     xen_host_record_opt_free(record->host);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_network.c
--- a/tools/libxen/src/xen_network.c    Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_network.c    Sat Oct 28 11:54:05 2006 +0100
@@ -74,6 +74,10 @@ void
 void
 xen_network_record_free(xen_network_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name_label);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_pif.c
--- a/tools/libxen/src/xen_pif.c        Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_pif.c        Sat Oct 28 11:54:05 2006 +0100
@@ -80,6 +80,10 @@ void
 void
 xen_pif_record_free(xen_pif_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_sr.c
--- a/tools/libxen/src/xen_sr.c Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_sr.c Sat Oct 28 11:54:05 2006 +0100
@@ -79,6 +79,10 @@ void
 void
 xen_sr_record_free(xen_sr_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name_label);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_user.c
--- a/tools/libxen/src/xen_user.c       Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_user.c       Sat Oct 28 11:54:05 2006 +0100
@@ -60,6 +60,10 @@ void
 void
 xen_user_record_free(xen_user_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->short_name);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_vbd.c
--- a/tools/libxen/src/xen_vbd.c        Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_vbd.c        Sat Oct 28 11:54:05 2006 +0100
@@ -79,6 +79,10 @@ void
 void
 xen_vbd_record_free(xen_vbd_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     xen_vm_record_opt_free(record->vm);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_vdi.c
--- a/tools/libxen/src/xen_vdi.c        Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_vdi.c        Sat Oct 28 11:54:05 2006 +0100
@@ -93,6 +93,10 @@ void
 void
 xen_vdi_record_free(xen_vdi_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name_label);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_vif.c
--- a/tools/libxen/src/xen_vif.c        Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_vif.c        Sat Oct 28 11:54:05 2006 +0100
@@ -84,6 +84,10 @@ void
 void
 xen_vif_record_free(xen_vif_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_vm.c
--- a/tools/libxen/src/xen_vm.c Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_vm.c Sat Oct 28 11:54:05 2006 +0100
@@ -189,6 +189,10 @@ void
 void
 xen_vm_record_free(xen_vm_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     free(record->name_label);
diff -r 0db0c19d3386 -r de00775e39da tools/libxen/src/xen_vtpm.c
--- a/tools/libxen/src/xen_vtpm.c       Sat Oct 28 11:50:35 2006 +0100
+++ b/tools/libxen/src/xen_vtpm.c       Sat Oct 28 11:54:05 2006 +0100
@@ -69,6 +69,10 @@ void
 void
 xen_vtpm_record_free(xen_vtpm_record *record)
 {
+    if (record == NULL)
+    {
+        return;
+    }
     free(record->handle);
     free(record->uuid);
     xen_vm_record_opt_free(record->vm);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.