/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Colin Leroy <colin@colino.net> and
+ * Copyright (C) 1999-2011 Colin Leroy <colin@colino.net> and
* the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
if (len > 0) {
if (fwrite(chars, 1, len, dstfp) < len) {
FILE_OP_ERROR(fname, "fwrite");
+ fclose(dstfp);
g_free(fname);
g_free(chars);
gpgme_data_release(plain);
gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from_addr)
{
MimeInfo *msgcontent, *sigmultipart, *newinfo;
- gchar *textstr, *micalg;
+ gchar *textstr, *micalg = NULL;
FILE *fp;
gchar *boundary = NULL;
gchar *sigcontent;
if (!sigcontent) {
gpgme_release(ctx);
+ g_free(micalg);
return FALSE;
}
real_content = sigcontent+strlen("-----BEGIN SIGNED MESSAGE-----\n");
if (!strstr(real_content, "-----END SIGNED MESSAGE-----")) {
debug_print("missing end\n");
gpgme_release(ctx);
+ g_free(micalg);
return FALSE;
}
*strstr(real_content, "-----END SIGNED MESSAGE-----") = '\0';
fp = g_fopen(tmpfile, "wb");
if (fp == NULL) {
perror("get_tmp_file");
+ g_free(kset);
return FALSE;
}
procmime_decode_content(msgcontent);
fp = g_fopen(tmpfile, "rb");
if (fp == NULL) {
perror("get_tmp_file");
+ g_free(kset);
return FALSE;
}
g_free(tmpfile);
gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
gpgme_release(ctx);
+ g_free(kset);
enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
if (!enccontent) {