mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
common: Use new function to print a failure of xtrymalloc.
* common/miscellaneous.c (xoutofcore): New. * common/strlist.c (append_to_strlist): Use instead of abort. (append_to_strlist_try): Use xtrymalloc instead of xmalloc. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
b8cb0973bc
commit
8776abbe02
3 changed files with 17 additions and 3 deletions
|
@ -128,8 +128,8 @@ append_to_strlist( strlist_t *list, const char *string )
|
|||
{
|
||||
strlist_t sl;
|
||||
sl = append_to_strlist_try (list, string);
|
||||
if (sl == NULL)
|
||||
abort ();
|
||||
if (!sl)
|
||||
xoutofcore ();
|
||||
return sl;
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ append_to_strlist_try (strlist_t *list, const char *string)
|
|||
{
|
||||
strlist_t r, sl;
|
||||
|
||||
sl = xmalloc( sizeof *sl + strlen(string));
|
||||
sl = xtrymalloc( sizeof *sl + strlen(string));
|
||||
if (sl == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue