mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-28 21:07:55 +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;
|
int len;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
len = vasprintf(ret, fmt, ap);
|
len = vasprintf(ret, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
if (len == -1)
|
if (len == -1)
|
||||||
errorx2(1, strerror(ENOMEM));
|
errorx2(1, NULL);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user