2005-08-28 [colin] 1.9.13cvs67
[claws.git] / src / imap.c
index d320ca42436092a2cfc8023bf2189f47919cd386..cba08c2d03c831be7102a5c25f21d8a1dd1a5885 100644 (file)
@@ -861,16 +861,18 @@ static void strip_crs(const gchar *file)
        gchar buf[4096];
        gchar *out = get_tmp_file();
        if (file == NULL)
-               return;
+               goto freeout;
        
        fp = fopen(file, "rb");
        if (!fp)
-               return;
+               goto freeout;
 
        outfp = fopen(out, "wb");
-       if (!outfp)
-               return;
-       
+       if (!outfp) {
+               fclose(fp);
+               goto freeout;
+       }
+
        while (fgets(buf, sizeof (buf), fp) != NULL) {
                while (strstr(buf, "\r")) {
                        gchar *cr = strstr(buf, "\r") ;
@@ -884,6 +886,8 @@ static void strip_crs(const gchar *file)
        fclose(fp);
        fclose(outfp);
        rename_force(out, file);
+freeout:
+       g_free(out);
 }
 
 static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid,