mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 17:53:37 +08:00
(__argp_error, __argp_failure): Check result of __asprintf call and don't use string if it failed.
This commit is contained in:
parent
7a7fc6396c
commit
9ddfc0595a
@ -1768,7 +1768,8 @@ __argp_error (const struct argp_state *state, const char *fmt, ...)
|
||||
{
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, fmt, ap);
|
||||
if (__asprintf (&buf, fmt, ap) < 0)
|
||||
buf = NULL;
|
||||
|
||||
__fwprintf (stream, L"%s: %s\n",
|
||||
state ? state->name : __argp_short_program_name (),
|
||||
@ -1846,7 +1847,8 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
|
||||
{
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, fmt, ap);
|
||||
if (__asprintf (&buf, fmt, ap) < 0)
|
||||
buf = NULL;
|
||||
|
||||
__fwprintf (stream, L": %s", buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user