Re: [PATCH 05/10] util: Need to check child JSON allocation before use

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

 



On 01/17/13 20:17, John Ferlan wrote:
---
  src/util/virlockspace.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 163404f..fd89598 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -483,6 +483,9 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace)
          virJSONValuePtr owners = NULL;
          size_t i;

+        if (!child)
+            goto error;

No error is raised if this code path is taken resulting into a strange error message. a virReportOOMError() should be reported here.

+
          if (virJSONValueArrayAppend(resources, child) < 0) {
              virJSONValueFree(child);
              goto error;


Peter

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]