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:
parent
acb9c62987
commit
1cf3def4be
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user