Mercurial > pidgin.yaz
comparison libpurple/desktopitem.c @ 28137:da33da2e1a1e
Fix a bunch of memory leaks reported by Josh Mueller. Refs #9822.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sun, 02 Aug 2009 05:04:41 +0000 |
parents | 0f0648daed6f |
children | f1437342cc0e |
comparison
equal
deleted
inserted
replaced
28136:c91832e94473 | 28137:da33da2e1a1e |
---|---|
829 * @return A newly allocated string which should be g_freed by the caller. | 829 * @return A newly allocated string which should be g_freed by the caller. |
830 */ | 830 */ |
831 static char * | 831 static char * |
832 try_english_key (PurpleDesktopItem *item, const char *key) | 832 try_english_key (PurpleDesktopItem *item, const char *key) |
833 { | 833 { |
834 char *str; | 834 char *str = NULL; |
835 char *locales[] = { "en_US", "en_GB", "en_AU", "en", NULL }; | 835 char *locales[] = { "en_US", "en_GB", "en_AU", "en", NULL }; |
836 int i; | 836 int i; |
837 | 837 |
838 str = NULL; | |
839 for (i = 0; locales[i] != NULL && str == NULL; i++) { | 838 for (i = 0; locales[i] != NULL && str == NULL; i++) { |
840 str = g_strdup (lookup_locale (item, key, locales[i])); | 839 str = g_strdup (lookup_locale (item, key, locales[i])); |
841 } | 840 } |
842 if (str != NULL) { | 841 if (str != NULL) { |
843 /* We need a 7-bit ascii string, so whack all | 842 /* We need a 7-bit ascii string, so whack all |