]> code.citadel.org Git - citadel.git/blobdiff - webcit/vcard_edit.c
* fix various leaks
[citadel.git] / webcit / vcard_edit.c
index 7e9355abf647c5e4f9b47bdb0983ee82a1da7840..a0c1795ba9162bcfe67d2fa5352346b03cdaf713 100644 (file)
@@ -119,6 +119,7 @@ wc_mime_attachment *load_vcard(message_summary *Msg)
 
        load_message(Msg, FoundCharset, &Error);
 
+       FreeStrBuf(&FoundCharset);
        /* look up the vcard... */
        it = GetNewHashPos(Msg->AllAttach, 0);
        while (GetNextHashPos(Msg->AllAttach, it, &len, &Key, &vMime) && 
@@ -1054,7 +1055,8 @@ void do_edit_vcard(long msgnum, char *partnum,
        wprintf("</td></tr></table>\n");
        do_template("endbox", NULL);
        wDumpContent(1);
-       DestroyMessageSummary(Msg);
+       if (Msg != NULL)
+               DestroyMessageSummary(Msg);
 }
 
 
@@ -1217,7 +1219,7 @@ void display_vcard_photo_img(void)
        const char *contentType;
        wcsession *WCC = WC;
 
-       msgnum = StrTol(WCC->UrlFragment2);
+       msgnum = StrBufExtract_long(WCC->Hdr->ReqLine, 0, '/');
        
        vcard = load_mimepart(msgnum,"1");
        v = VCardLoad(vcard);