summaryrefslogtreecommitdiffstats
path: root/common/strlist.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-04-25 17:26:57 +0200
committerWerner Koch <wk@gnupg.org>2016-04-25 17:26:57 +0200
commit8776abbe02935e720018f3ef6ffd48f21435ff8b (patch)
tree6a848deb9fd8199520300824752816cec32365d8 /common/strlist.c
parentcommon: Drop unused variables, fix warnings. (diff)
downloadgnupg2-8776abbe02935e720018f3ef6ffd48f21435ff8b.tar.xz
gnupg2-8776abbe02935e720018f3ef6ffd48f21435ff8b.zip
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>
Diffstat (limited to 'common/strlist.c')
-rw-r--r--common/strlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/strlist.c b/common/strlist.c
index 319d034e2..d4f864496 100644
--- a/common/strlist.c
+++ b/common/strlist.c
@@ -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;