Mercurial > pidgin
comparison src/list.c @ 4441:474a0a88dd5e
[gaim-migrate @ 4716]
niqueco noticed that I don't clean up after myself.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 28 Jan 2003 05:56:38 +0000 |
parents | 7693d84255e7 |
children | fd53864d880f |
comparison
equal
deleted
inserted
replaced
4440:d9e4eacf6b46 | 4441:474a0a88dd5e |
---|---|
931 NULL, | 931 NULL, |
932 blist_error_handler | 932 blist_error_handler |
933 }; | 933 }; |
934 | 934 |
935 static gboolean gaim_blist_read(const char *filename) { | 935 static gboolean gaim_blist_read(const char *filename) { |
936 gchar *contents; | 936 gchar *contents = NULL; |
937 gsize length; | 937 gsize length; |
938 GMarkupParseContext *context; | 938 GMarkupParseContext *context; |
939 GError *error = NULL; | 939 GError *error = NULL; |
940 if(!g_file_get_contents(filename, &contents, &length, &error)) { | 940 if(!g_file_get_contents(filename, &contents, &length, &error)) { |
941 debug_printf("error reading blist: %s\n", error->message); | 941 debug_printf("error reading blist: %s\n", error->message); |
945 | 945 |
946 context = g_markup_parse_context_new(&blist_parser, 0, NULL, NULL); | 946 context = g_markup_parse_context_new(&blist_parser, 0, NULL, NULL); |
947 | 947 |
948 if(!g_markup_parse_context_parse(context, contents, length, NULL)) { | 948 if(!g_markup_parse_context_parse(context, contents, length, NULL)) { |
949 g_markup_parse_context_free(context); | 949 g_markup_parse_context_free(context); |
950 g_free(contents); | |
950 return FALSE; | 951 return FALSE; |
951 } | 952 } |
952 | 953 |
953 if(!g_markup_parse_context_end_parse(context, NULL)) { | 954 if(!g_markup_parse_context_end_parse(context, NULL)) { |
954 debug_printf("error parsing blist\n"); | 955 debug_printf("error parsing blist\n"); |
955 g_markup_parse_context_free(context); | 956 g_markup_parse_context_free(context); |
957 g_free(contents); | |
956 return FALSE; | 958 return FALSE; |
957 } | 959 } |
958 | 960 |
959 g_markup_parse_context_free(context); | 961 g_markup_parse_context_free(context); |
962 g_free(contents); | |
963 | |
960 if(blist_parser_error_occurred) | 964 if(blist_parser_error_occurred) |
961 return FALSE; | 965 return FALSE; |
962 | 966 |
963 return TRUE; | 967 return TRUE; |
964 } | 968 } |