comparison src/prefs.c @ 6040:80e3641ee9eb

[gaim-migrate @ 6490] Various minor memleak fixes, and a rephrasing of an oscar error message. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 06 Jul 2003 06:57:42 +0000
parents 96e0ac28d933
children dc42b27101c0
comparison
equal deleted inserted replaced
6039:0c4d0c93c8c5 6040:80e3641ee9eb
828 828
829 if(!g_file_get_contents(filename, &contents, &length, &error)) { 829 if(!g_file_get_contents(filename, &contents, &length, &error)) {
830 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error reading prefs: %s\n", 830 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error reading prefs: %s\n",
831 error->message); 831 error->message);
832 g_error_free(error); 832 g_error_free(error);
833 g_free(filename);
833 prefs_is_loaded = TRUE; 834 prefs_is_loaded = TRUE;
835
834 return FALSE; 836 return FALSE;
835 } 837 }
836 838
837 context = g_markup_parse_context_new(&prefs_parser, 0, NULL, NULL); 839 context = g_markup_parse_context_new(&prefs_parser, 0, NULL, NULL);
838 840
839 if(!g_markup_parse_context_parse(context, contents, length, NULL)) { 841 if(!g_markup_parse_context_parse(context, contents, length, NULL)) {
840 g_markup_parse_context_free(context); 842 g_markup_parse_context_free(context);
841 g_free(contents); 843 g_free(contents);
844 g_free(filename);
842 prefs_is_loaded = TRUE; 845 prefs_is_loaded = TRUE;
846
843 return FALSE; 847 return FALSE;
844 } 848 }
845 849
846 if(!g_markup_parse_context_end_parse(context, NULL)) { 850 if(!g_markup_parse_context_end_parse(context, NULL)) {
847 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error parsing %s\n", filename); 851 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error parsing %s\n", filename);
848 g_markup_parse_context_free(context); 852 g_markup_parse_context_free(context);
849 g_free(contents); 853 g_free(contents);
854 g_free(filename);
850 prefs_is_loaded = TRUE; 855 prefs_is_loaded = TRUE;
856
851 return FALSE; 857 return FALSE;
852 } 858 }
853 859
860 gaim_debug(GAIM_DEBUG_INFO, "prefs", "Finished reading %s\n", filename);
854 g_markup_parse_context_free(context); 861 g_markup_parse_context_free(context);
855 g_free(contents); 862 g_free(contents);
856
857 gaim_debug(GAIM_DEBUG_INFO, "prefs", "Finished reading %s\n", filename);
858 g_free(filename); 863 g_free(filename);
859 prefs_is_loaded = TRUE; 864 prefs_is_loaded = TRUE;
860 865
861 return TRUE; 866 return TRUE;
862 } 867 }