projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3117fda
)
Handle an unlikely fopen failure in compose_write_to_file()
author
Andrej Kacian
<ticho@claws-mail.org>
Thu, 25 Jun 2015 15:58:50 +0000
(17:58 +0200)
committer
Andrej Kacian
<ticho@claws-mail.org>
Thu, 25 Jun 2015 15:58:50 +0000
(17:58 +0200)
src/compose.c
patch
|
blob
|
history
diff --git
a/src/compose.c
b/src/compose.c
index d854340ba4e2bd1fd5fd38e578ad6f8cde8ab075..72c3fd4a79222044b39a2ee2919fc918ec220628 100644
(file)
--- 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. */
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");
}
} else {
g_warning("couldn't get tempfile\n");
}