2009-12-15 Marcus Brinkmann <marcus@g10code.de>

* assuan-support.c (my_spawn): Calloc, not malloc, the fd_items.
This commit is contained in:
Marcus Brinkmann 2009-12-15 01:01:40 +00:00
parent 31844d30cd
commit 1094c0a5d3
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2009-12-15 Marcus Brinkmann <marcus@g10code.de>
* assuan-support.c (my_spawn): Calloc, not malloc, the fd_items.
2009-12-10 Werner Koch <wk@g10code.com> 2009-12-10 Werner Koch <wk@g10code.com>
* debug.c (debug_init): Test on sgid process. * debug.c (debug_init): Test on sgid process.

View File

@ -130,7 +130,7 @@ my_spawn (assuan_context_t ctx, pid_t *r_pid, const char *name,
} }
/* fd_in, fd_out, terminator */ /* fd_in, fd_out, terminator */
i += 3; i += 3;
fd_items = malloc (sizeof (struct spawn_fd_item_s) * i); fd_items = calloc (i, sizeof (struct spawn_fd_item_s));
if (! fd_items) if (! fd_items)
return -1; return -1;
i = 0; i = 0;