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

[libvirt] sysinfo: fix lack of error check in virSysinfoFormat().



Fix lack of error check in virSysinfoFormat().

Signed-off-by: Minoru Usui <usui mxm nes nec co jp>
---
 src/util/sysinfo.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index 31ebdc2..bff1cb8 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -796,6 +796,11 @@ virSysinfoFormat(virSysinfoDefPtr def, const char *prefix)
 
     virBufferAsprintf(&buf, "%s</sysinfo>\n", prefix);
 
+    if (virBufferError(&buf)) {
+        virReportOOMError();
+        return NULL;
+    }
+
     return virBufferContentAndReset(&buf);
 }
 
-- 
1.7.1
-- 
Minoru Usui <usui mxm nes nec co jp>


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