From 23195651f520b23845ade9c1745135e363b0a068 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Wed, 22 May 2013 12:56:37 +0200 Subject: [PATCH] conf: add missing OOM errors --- src/conf/virchrdev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 17b1f05f86..36fbb97090 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -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) { -- 2.39.5