mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-13 22:21:09 +02:00
common: Fix error handling.
* common/exechelp-posix.c (store_result): Use xtrymalloc. (gnupg_wait_processes): Likewise, and check result. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
9082bde01c
commit
845e2cc201
@ -610,7 +610,7 @@ store_result (pid_t pid, int exitcode)
|
|||||||
{
|
{
|
||||||
struct terminated_child *c;
|
struct terminated_child *c;
|
||||||
|
|
||||||
c = xmalloc (sizeof *c);
|
c = xtrymalloc (sizeof *c);
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
return gpg_err_code_from_syserror ();
|
return gpg_err_code_from_syserror ();
|
||||||
|
|
||||||
@ -660,7 +660,11 @@ gnupg_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
|
|||||||
int *dummy = NULL;
|
int *dummy = NULL;
|
||||||
|
|
||||||
if (r_exitcodes == NULL)
|
if (r_exitcodes == NULL)
|
||||||
dummy = r_exitcodes = xmalloc (sizeof *r_exitcodes * count);
|
{
|
||||||
|
dummy = r_exitcodes = xtrymalloc (sizeof *r_exitcodes * count);
|
||||||
|
if (dummy == NULL)
|
||||||
|
return gpg_err_code_from_syserror ();
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0, left = count; i < count; i++)
|
for (i = 0, left = count; i < count; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user