/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 Colin Leroy <colin@colino.net> and
- * the Claws Mail team
+ * Copyright (C) 1999-2016 Colin Leroy and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
gpgme_ctx_t ctx;
if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR) {
- debug_print("gpgme_new failed");
+ debug_print("gpgme_new failed\n");
return NULL;
}
decinfo = g_node_first_child(newinfo->node) != NULL ?
g_node_first_child(newinfo->node)->data : NULL;
- if (decinfo == NULL)
+ if (decinfo == NULL) {
+ g_free(textstr);
return -1;
+ }
g_node_unlink(decinfo->node);
- procmime_mimeinfo_free_all(newinfo);
+ procmime_mimeinfo_free_all(&newinfo);
decinfo->tmp = TRUE;
parentinfo = procmime_mimeinfo_parent(mimeinfo);
}
g_node_unlink(decinfo->node);
- procmime_mimeinfo_free_all(parseinfo);
+ procmime_mimeinfo_free_all(&parseinfo);
decinfo->tmp = TRUE;
tmpfile = get_tmp_file();
fp = g_fopen(tmpfile, "wb");
if (fp == NULL) {
- perror("get_tmp_file");
+ FILE_OP_ERROR(tmpfile, "create");
g_free(kset);
return FALSE;
}
canonicalize_file_replace(tmpfile);
fp = g_fopen(tmpfile, "rb");
if (fp == NULL) {
- perror("get_tmp_file");
+ FILE_OP_ERROR(tmpfile, "open");
g_free(kset);
return FALSE;
}
enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
if (!enccontent) {
- g_warning("no enccontent\n");
+ g_warning("no enccontent");
return FALSE;
}
fclose(fp);
claws_unlink(tmpfile);
g_free(tmpfile);
+ g_free(enccontent);
return FALSE;
}
if (fclose(fp) == EOF) {
FILE_OP_ERROR(tmpfile, "fclose");
claws_unlink(tmpfile);
g_free(tmpfile);
+ g_free(enccontent);
return FALSE;
}
} else {
- perror("get_tmp_file");
+ FILE_OP_ERROR(tmpfile, "create");
g_free(tmpfile);
g_free(enccontent);
return FALSE;
g_free(textstr);
/* create encrypted multipart */
- procmime_mimeinfo_free_all(msgcontent);
+ procmime_mimeinfo_free_all(&msgcontent);
g_node_append(mimeinfo->node, encmultipart->node);
encmultipart->content = MIMECONTENT_FILE;