From 1cf3def4bede6ad5d18e983650a6bf1c8b36b636 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 2 Oct 2012 14:45:18 -0400 Subject: [PATCH] If vasprintf() fails, just use the errno it sets instead of assuming ENOMEM. --- common/alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/alloc.c b/common/alloc.c index 828271e03..5c51365f1 100644 --- a/common/alloc.c +++ b/common/alloc.c @@ -249,12 +249,13 @@ easprintf(char **ret, const char *fmt, ...) { int len; va_list ap; + va_start(ap, fmt); len = vasprintf(ret, fmt, ap); va_end(ap); if (len == -1) - errorx2(1, strerror(ENOMEM)); + errorx2(1, NULL); return len; }