Fix small leak on failed realloc in _g_locale_get_charset_aliases

2006-10-26  Pascal Terjan  <pterjan@linuxfr.org>

	* glib/libcharset/localcharset.c: Fix small leak on failed
	realloc in _g_locale_get_charset_aliases (#338582)
This commit is contained in:
Pascal Terjan 2006-10-26 21:09:04 +00:00 committed by Pascal Terjan
parent 3fb0fb2ef4
commit dedf19723f
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-10-26 Pascal Terjan <pterjan@linuxfr.org>
* glib/libcharset/localcharset.c: Fix small leak on failed
realloc in _g_locale_get_charset_aliases (#338582)
2006-10-16 Behdad Esfahbod <behdad@gnome.org>
* glib/gnulib/Makefile.am: Add $(GLIB_DEBUG_FLAGS). (#362543,

View File

@ -183,8 +183,12 @@ _g_locale_get_charset_aliases (void)
}
else
{
char * p = res_ptr;
res_size += l1 + 1 + l2 + 1;
res_ptr = (char *) realloc (res_ptr, res_size + 1);
if (res_ptr == NULL) {
free(p);
}
}
if (res_ptr == NULL)
{