aboutsummaryrefslogtreecommitdiff
path: root/locale/findlocale.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-28 16:59:30 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-28 16:59:30 -0400
commit4f031072a5055abd83717820b59efdaa463d5853 (patch)
treed6a3da4cf7e5d6b18de8c56cabee75f4c0e017fa /locale/findlocale.c
parent9ce9d0ec9001a7e7ac25653f3026233cdd1c0b1f (diff)
downloadglibc-4f031072a5055abd83717820b59efdaa463d5853.zip
glibc-4f031072a5055abd83717820b59efdaa463d5853.tar.gz
glibc-4f031072a5055abd83717820b59efdaa463d5853.tar.bz2
Handle failure of _nl_explode_name in all cases
Diffstat (limited to 'locale/findlocale.c')
-rw-r--r--locale/findlocale.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/locale/findlocale.c b/locale/findlocale.c
index 6b88c96..2fec9a7 100644
--- a/locale/findlocale.c
+++ b/locale/findlocale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2003, 2006, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -140,6 +140,9 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
*/
mask = _nl_explode_name (loc_name, &language, &modifier, &territory,
&codeset, &normalized_codeset);
+ if (mask == -1)
+ /* Memory allocate problem. */
+ return NULL;
/* If exactly this locale was already asked for we have an entry with
the complete name. */