From 8776abbe02935e720018f3ef6ffd48f21435ff8b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 25 Apr 2016 17:26:57 +0200 Subject: 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 --- common/strlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/strlist.c') 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; -- cgit v1.2.3