]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: add missing OOM errors
authorJán Tomko <jtomko@redhat.com>
Wed, 22 May 2013 10:56:37 +0000 (12:56 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 23 May 2013 16:56:36 +0000 (18:56 +0200)
src/conf/virchrdev.c

index 17b1f05f8669f488a161156a2607dff81cafe848..36fbb97090f3ed093c0ba4ff5a1c6fcf43b7090a 100644 (file)
@@ -89,8 +89,10 @@ static char *virChrdevLockFilePath(const char *dev)
         ++p;
     }
 
-    if (virAsprintf(&path, "%s/LCK..%s", VIR_CHRDEV_LOCK_FILE_PATH, filename) < 0)
+    if (virAsprintf(&path, "%s/LCK..%s", VIR_CHRDEV_LOCK_FILE_PATH, filename) < 0) {
+        virReportOOMError();
         goto cleanup;
+    }
 
     sanitizedPath = virFileSanitizePath(path);
 
@@ -136,8 +138,10 @@ static int virChrdevLockFileCreate(const char *dev)
 
     /* ensure correct format according to filesystem hierarchy standard */
     /* http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES */
-    if (virAsprintf(&pidStr, "%10lld\n", (long long) getpid()) < 0)
+    if (virAsprintf(&pidStr, "%10lld\n", (long long) getpid()) < 0) {
+        virReportOOMError();
         goto cleanup;
+    }
 
     /* create the lock file */
     if ((lockfd = open(path, O_WRONLY | O_CREAT | O_EXCL, 00644)) < 0) {