fix leak, rename some vars
authorColin Leroy <colin@colino.net>
Sat, 9 Nov 2002 13:02:30 +0000 (13:02 +0000)
committerColin Leroy <colin@colino.net>
Sat, 9 Nov 2002 13:02:30 +0000 (13:02 +0000)
ChangeLog.claws
configure.in
src/folder.c

index 65a3f1c5d29b450124528618dc598e6d1e0e9341..476b43b01a42af627dd1508f2b1a87cb91a0b666 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-09 [colin]     0.8.5claws102
+
+       * src/folder.c
+               Fix a leak found by Christoph, use better variable
+               names
+
 2002-11-09 [colin]     0.8.5claws101
 
        * src/folder.c
index 49b9289e0397d8fcaa28ca16c27a656ed061ad97..abf2e2030c5b91fa843f196f6f7275996c9934dd 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws101
+EXTRA_VERSION=claws102
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index b650d1fd863fa63a6444237134a213d604d2d115..35d804bcd66519f6bda30c967b53bb4ef96b563a 100644 (file)
@@ -1500,7 +1500,7 @@ FolderItem *folder_item_move_recursive (FolderItem *src, FolderItem *dest)
 FolderItem *folder_item_move_to(FolderItem *src, FolderItem *dest)
 {
        FolderItem *tmp = dest->parent;
-       char * srcpath, * dstpath;
+       char * src_identifier, * dst_identifier, * new_identifier;
        char * phys_srcpath, * phys_dstpath;
        GNode *src_node;
        
@@ -1514,25 +1514,25 @@ FolderItem *folder_item_move_to(FolderItem *src, FolderItem *dest)
        
        tmp = src->parent;
        
-       srcpath = folder_item_get_identifier(src);
-       dstpath = folder_item_get_identifier(dest);
+       src_identifier = folder_item_get_identifier(src);
+       dst_identifier = folder_item_get_identifier(dest);
        
-       if(dstpath == NULL && dest->folder && dest->parent == NULL) {
+       if(dst_identifier == NULL && dest->folder && dest->parent == NULL) {
                /* dest can be a root folder */
-               dstpath = folder_get_identifier(dest->folder);
+               dst_identifier = folder_get_identifier(dest->folder);
        }
-       if (srcpath == NULL || dstpath == NULL) {
+       if (src_identifier == NULL || dst_identifier == NULL) {
                printf("Can't get identifiers\n");
                return NULL;
        }
 
        phys_srcpath = folder_item_get_path(src);
-       phys_dstpath = g_strconcat(folder_item_get_path(dest),G_DIR_SEPARATOR_S,g_basename(srcpath),NULL);
+       phys_dstpath = g_strconcat(folder_item_get_path(dest),G_DIR_SEPARATOR_S,g_basename(phys_srcpath),NULL);
 
        if (src->parent == dest) {
                alertpanel_error(_("Source and destination are the same."));
-               g_free(srcpath);
-               g_free(dstpath);
+               g_free(src_identifier);
+               g_free(dst_identifier);
                g_free(phys_srcpath);
                g_free(phys_dstpath);
                return NULL;
@@ -1553,15 +1553,14 @@ FolderItem *folder_item_move_to(FolderItem *src, FolderItem *dest)
        /* not to much worry if remove fails, move has been done */
        
        debug_print("updating rules ....\n");
-       prefs_filtering_rename_path(srcpath, g_strconcat(dstpath, 
-                                               G_DIR_SEPARATOR_S, 
-                                               g_basename(srcpath), 
-                                               NULL));
+       new_identifier = g_strconcat(dst_identifier, G_DIR_SEPARATOR_S, g_basename(phys_srcpath), NULL);
+       prefs_filtering_rename_path(src_identifier, new_identifier);
 
        folder_write_list();
 
-       g_free(srcpath);
-       g_free(dstpath);
+       g_free(src_identifier);
+       g_free(dst_identifier);
+       g_free(new_identifier);
        g_free(phys_srcpath);
        g_free(phys_dstpath);