RSSyl: Free GError from memory where necessary.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 16 Jun 2015 21:04:24 +0000 (23:04 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 16 Jun 2015 21:04:24 +0000 (23:04 +0200)
src/plugins/rssyl/parse822.c
src/plugins/rssyl/rssyl.c
src/plugins/rssyl/rssyl_deleted.c

index 6a700b5..5eadc4a 100644 (file)
@@ -63,8 +63,10 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 
        g_file_get_contents(path, &contents, NULL, &error);
 
-       if( error )
+       if( error ) {
                g_warning("GError: '%s'\n", error->message);
+               g_error_free(error);
+       }
 
        if( contents != NULL ) {
                lines = strsplit_no_copy(contents, '\n');
@@ -267,6 +269,7 @@ static void rssyl_folder_read_existing_real(RFolderItem *ritem)
                FILE_OP_ERROR(path, "g_dir_open");
                debug_print("g_dir_open on \"%s\" failed with error %d (%s)\n",
                                path, error->code, error->message);
+               g_error_free(error);
                g_free(path);
                return;
        }
index 00a5d37..5983495 100644 (file)
@@ -219,6 +219,7 @@ static void rssyl_get_last_num(Folder *folder, FolderItem *item)
                FILE_OP_ERROR(item->path, "g_dir_open");
                debug_print("g_dir_open() failed on \"%s\", error %d (%s).\n",
                                path, error->code, error->message);
+               g_error_free(error);
                g_free(path);
                return;
        }
@@ -672,6 +673,7 @@ static gint rssyl_get_num_list(Folder *folder, FolderItem *item,
                FILE_OP_ERROR(item->path, "opendir");
                debug_print("g_dir_open() failed on \"%s\", error %d (%s).\n",
                                path, error->code, error->message);
+               g_error_free(error);
                g_free(path);
                return -1;
        }
index 01cb0da..6f3a06e 100644 (file)
@@ -104,8 +104,10 @@ GSList *rssyl_deleted_update(RFolderItem *ritem)
 
        g_file_get_contents(deleted_file, &contents, NULL, &error);
 
-       if (error)
+       if (error) {
                g_warning("GError: '%s'\n", error->message);
+               g_error_free(error);
+       }
 
        if (contents != NULL) {
                lines = strsplit_no_copy(contents, '\n');