[Commits] [SCM] claws branch, master, updated. 3.11.1-173-geb9beac

ticho at claws-mail.org ticho at claws-mail.org
Thu Jun 25 17:59:32 CEST 2015


The branch, master has been updated
       via  eb9beace00cd9d94fdd8f4950c24251f9e862acf (commit)
      from  3117fda50fcdd9cb79114b6abd3cad92950b0307 (commit)

Summary of changes:
 src/compose.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)


- Log -----------------------------------------------------------------
commit eb9beace00cd9d94fdd8f4950c24251f9e862acf
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jun 25 17:58:50 2015 +0200

    Handle an unlikely fopen failure in compose_write_to_file()

diff --git a/src/compose.c b/src/compose.c
index d854340..72c3fd4 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -5757,16 +5757,19 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool
 					g_free(content);
 
 					/* Now write the unencrypted body. */
-					tmpfp = g_fopen(tmp_enc_file, "a");
-					procmime_write_mimeinfo(mimemsg, tmpfp);
-					fclose(tmpfp);
+					if ((tmpfp = g_fopen(tmp_enc_file, "a")) != NULL) {
+						procmime_write_mimeinfo(mimemsg, tmpfp);
+						fclose(tmpfp);
 
-					outbox = folder_find_item_from_identifier(compose_get_save_to(compose));
-					if (!outbox)
-						outbox = folder_get_default_outbox();
+						outbox = folder_find_item_from_identifier(compose_get_save_to(compose));
+						if (!outbox)
+							outbox = folder_get_default_outbox();
 
-					procmsg_save_to_outbox(outbox, tmp_enc_file, TRUE);
-					claws_unlink(tmp_enc_file);
+						procmsg_save_to_outbox(outbox, tmp_enc_file, TRUE);
+						claws_unlink(tmp_enc_file);
+					} else {
+						g_warning("Can't open file %s\n", tmp_enc_file);
+					}
 				} else {
 					g_warning("couldn't get tempfile\n");
 				}

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list