about summary refs log tree commit diff
path: root/elf/ldconfig.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-06-01 22:18:24 +0000
committerUlrich Drepper <drepper@redhat.com>2004-06-01 22:18:24 +0000
commit322861e8b62dbca030a66f9ab37e6688b223c65f (patch)
tree4ee930f44d4484f577cae54b3845e91ae6517d57 /elf/ldconfig.c
parent9ddfc0595a4444ee13aec46e118b3b3463012267 (diff)
downloadglibc-322861e8b62dbca030a66f9ab37e6688b223c65f.tar.gz
glibc-322861e8b62dbca030a66f9ab37e6688b223c65f.tar.xz
glibc-322861e8b62dbca030a66f9ab37e6688b223c65f.zip
Update.
2004-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	* argp/argp-help.c (__argp_error, __argp_failure): Check result
	of __asprintf call and don't use string if it failed.
	* stdio-common/psignal.c (psignal): Likewise.
	* locale/programs/localedef.c (more_help): Likewise.
	* resolv/res_hconf.c (arg_service_list, arg_trimdomain_list,
	arg_bool, parse_line): Check result of __asprintf calls and
	don't use string if they failed.
	* sunrpc/svc_simple.c (registerrpc, universal): Likewise.
	* elf/ldconfig.c (parse_conf_include): Check result of __asprintf
	call and exit if it failed.
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;
     }