RE: [PATCH] Attachments in mailto: URLs



Seems to me that a memory leak has been introduced here. If add_attachment()
is called, then g_free(val) is not but "val = decode_and_strdup(ptr,'&',
&ptr);" is called every time.

Steve

-----Original Message-----
From: Johan Brannlund
To: balsa-list gnome org
Sent: 10/31/2006 11:06 PM
Subject: [PATCH] Attachments in mailto: URLs

I noticed when trying to mail pictures from f-spot that Balsa didn't
include the attachments. A bit of digging revealed that the reason is
that
Balsa doesn't understand things like
"mailto:helmut example com?attach=/tmp/strudel.jpg"

I hacked up a small patch for this, included below. In case it suffers
from whitespace damage, it's also available at
http://nullinfinity.org/attach.patch .

Regards,

Johan

--- origbalsa/src/sendmsg-window.c      2006-10-08 08:52:03.000000000
-0700
+++ balsa/src/sendmsg-window.c  2006-10-31 19:59:41.000000000 -0800
@@ -4596,8 +4596,12 @@
        key = decode_and_strdup(ptr,'=', &ptr);
        if(ptr) {
            val = decode_and_strdup(ptr,'&', &ptr);
-           func(data, key, val);
-           g_free(val);
+            if (g_ascii_strcasecmp(key, "attach") == 0)
+                add_attachment(data,val,FALSE,NULL);
+           else {
+                func(data, key, val);
+                g_free(val);
+            }
        }
        g_free(key);
     }

_______________________________________________
balsa-list mailing list
balsa-list gnome org
http://mail.gnome.org/mailman/listinfo/balsa-list



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