[gvfs] [FTP] Plug memleak



commit 42bab3f1fe676ad2b089c321ac0a06e16d0feb15
Author: Benjamin Otte <otte gnome org>
Date:   Mon Aug 10 22:02:22 2009 +0200

    [FTP] Plug memleak

 daemon/gvfsftptask.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c
index d7cb272..c52637b 100644
--- a/daemon/gvfsftptask.c
+++ b/daemon/gvfsftptask.c
@@ -689,33 +689,40 @@ g_vfs_ftp_task_receive (GVfsFtpTask *        task,
         if (flags & G_VFS_FTP_PASS_100)
           break;
         g_vfs_ftp_task_set_error_from_response (task, response);
-        return 0;
+        break;
       case 2:
         if (flags & G_VFS_FTP_FAIL_200)
-          {
-            g_vfs_ftp_task_set_error_from_response (task, response);
-            return 0;
-          }
+          g_vfs_ftp_task_set_error_from_response (task, response);
         break;
       case 3:
         if (flags & G_VFS_FTP_PASS_300)
           break;
         g_vfs_ftp_task_set_error_from_response (task, response);
-        return 0;
+        break;
       case 4:
         g_vfs_ftp_task_set_error_from_response (task, response);
-        return 0;
+        break;
       case 5:
         if ((flags & G_VFS_FTP_PASS_500) ||
             (response == 550 && (flags & G_VFS_FTP_PASS_550)))
           break;
         g_vfs_ftp_task_set_error_from_response (task, response);
-        return 0;
+        break;
       default:
         g_assert_not_reached ();
         break;
     }
 
+  if (g_vfs_ftp_task_is_in_error (task))
+    {
+      if (response != 0 && reply)
+        {
+          g_strfreev (*reply);
+          *reply = NULL;
+        }
+      response = 0;
+    }
+
   return response;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]