diff options
Diffstat (limited to 'intl/finddomain.c')
-rw-r--r-- | intl/finddomain.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/intl/finddomain.c b/intl/finddomain.c index a25bebcb9..cab2c9990 100644 --- a/intl/finddomain.c +++ b/intl/finddomain.c @@ -1,5 +1,5 @@ /* Handle list of needed message catalogs - Copyright (C) 1995-1999, 2000-2001, 2003-2006 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2001, 2003-2007 Free Software Foundation, Inc. Written by Ulrich Drepper <[email protected]>, 1995. This program is free software; you can redistribute it and/or modify it @@ -144,6 +144,9 @@ _nl_find_domain (const char *dirname, char *locale, look for the language. Termination symbols are `_', '.', and `@'. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset); + if (mask == -1) + /* This means we are out of core. */ + return NULL; /* We need to protect modifying the _NL_LOADED_DOMAINS data. */ gl_rwlock_wrlock (lock); @@ -159,7 +162,7 @@ _nl_find_domain (const char *dirname, char *locale, if (retval == NULL) /* This means we are out of core. */ - return NULL; + goto out; if (retval->decided <= 0) _nl_load_domain (retval, domainbinding); @@ -179,6 +182,7 @@ _nl_find_domain (const char *dirname, char *locale, if (alias_value != NULL) free (locale); +out: /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); |