about summary refs log tree commit diff
path: root/elf/ldconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/ldconfig.c')
-rw-r--r--elf/ldconfig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 222d862bd2..bf103c7269 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1034,7 +1034,9 @@ parse_conf_include (const char *config_file, unsigned int lineno,
   char *copy = NULL;
   if (pattern[0] != '/' && strchr (config_file, '/') != NULL)
     {
-      asprintf (&copy, "%s/%s", dirname (strdupa (config_file)), pattern);
+      if (asprintf (&copy, "%s/%s", dirname (strdupa (config_file)),
+		    pattern) < 0)
+	error (EXIT_FAILURE, 0, _("memory exhausted"));
       pattern = copy;
     }