[evolution-data-server/gnome-2-32] Bug #608557 - CamelOfflineJournal can call fclose with NULL
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-2-32] Bug #608557 - CamelOfflineJournal can call fclose with NULL
- Date: Wed, 13 Oct 2010 15:23:51 +0000 (UTC)
commit fc520c48f928b15a7aecae6d17a06c0584f29d9e
Author: Milan Crha <mcrha redhat com>
Date: Wed Oct 13 17:21:49 2010 +0200
Bug #608557 - CamelOfflineJournal can call fclose with NULL
camel/camel-offline-journal.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-offline-journal.c b/camel/camel-offline-journal.c
index 76006cb..0344ab8 100644
--- a/camel/camel-offline-journal.c
+++ b/camel/camel-offline-journal.c
@@ -148,6 +148,9 @@ camel_offline_journal_write (CamelOfflineJournal *journal,
}
fp = fdopen (fd, "w");
+ if (!fp)
+ goto exception;
+
entry = journal->queue.head;
while (entry->next) {
if (CAMEL_OFFLINE_JOURNAL_GET_CLASS (journal)->entry_write (journal, entry, fp) == -1)
@@ -158,7 +161,8 @@ camel_offline_journal_write (CamelOfflineJournal *journal,
if (fsync (fd) == -1)
goto exception;
- fclose (fp);
+ if (fp)
+ fclose (fp);
return 0;
@@ -171,7 +175,8 @@ camel_offline_journal_write (CamelOfflineJournal *journal,
camel_folder_get_full_name (journal->folder),
g_strerror (errno));
- fclose (fp);
+ if (fp)
+ fclose (fp);
return -1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]