2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

If vasprintf() fails, just use the errno it sets instead of assuming

ENOMEM.
This commit is contained in:
Todd C. Miller 2012-10-02 14:45:18 -04:00
parent acb9c62987
commit 1cf3def4be

View 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;
}