]> granicus.if.org Git - sudo/commitdiff
If vasprintf() fails, just use the errno it sets instead of assuming
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 2 Oct 2012 18:45:18 +0000 (14:45 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 2 Oct 2012 18:45:18 +0000 (14:45 -0400)
ENOMEM.

common/alloc.c

index 828271e03f0e88bc8625f29c86cc03a91eeed229..5c51365f12b2c4aa97b3543b8ce26056817a7e55 100644 (file)
@@ -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;
 }