diff options
author | Werner Koch <wk@gnupg.org> | 2016-04-25 17:26:57 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-04-25 17:26:57 +0200 |
commit | 8776abbe02935e720018f3ef6ffd48f21435ff8b (patch) | |
tree | 6a848deb9fd8199520300824752816cec32365d8 /common/strlist.c | |
parent | common: Drop unused variables, fix warnings. (diff) | |
download | gnupg2-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.c | 6 |
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; |