From: Todd C. Miller Date: Tue, 2 Oct 2012 18:45:18 +0000 (-0400) Subject: If vasprintf() fails, just use the errno it sets instead of assuming X-Git-Tag: SUDO_1_8_7~1^2~377 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cf3def4bede6ad5d18e983650a6bf1c8b36b636;p=sudo If vasprintf() fails, just use the errno it sets instead of assuming ENOMEM. --- 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; }