Use "unable to allocate memory" warning on malloc failure.

This is consistent with the rest of the sudo source code.
This commit is contained in:
Todd C. Miller
2022-06-29 10:00:03 -06:00
parent 3e21c8da5c
commit 54ed54d94e
2 changed files with 26 additions and 24 deletions

View File

@@ -288,7 +288,7 @@ read_io_buf(struct client_closure *closure)
free(closure->buf);
closure->bufsize = sudo_pow2_roundup(timing->u.nbytes);
if ((closure->buf = malloc(closure->bufsize)) == NULL) {
sudo_warn(NULL);
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
timing->u.nbytes = 0;
debug_return_bool(false);
}