[gnote/gnome-3-36] Fix crash in case of exception when creating manifest
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote/gnome-3-36] Fix crash in case of exception when creating manifest
- Date: Sun, 10 May 2020 13:11:06 +0000 (UTC)
commit 284825bfa8ccf8b7a290c3f8da44b2c26aa3da13
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Mar 22 17:17:12 2020 +0200
Fix crash in case of exception when creating manifest
src/synchronization/filesystemsyncserver.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/synchronization/filesystemsyncserver.cpp b/src/synchronization/filesystemsyncserver.cpp
index 59c90456..c4ce3416 100644
--- a/src/synchronization/filesystemsyncserver.cpp
+++ b/src/synchronization/filesystemsyncserver.cpp
@@ -308,13 +308,16 @@ bool FileSystemSyncServer::commit_sync_transaction()
xml->close();
Glib::ustring xml_content = xml->to_string();
delete xml;
+ xml = nullptr;
auto stream = manifest_file->create_file(Gio::FILE_CREATE_REPLACE_DESTINATION);
stream->write(xml_content);
stream->close();
}
catch(...) {
- xml->close();
- delete xml;
+ if(xml) {
+ xml->close();
+ delete xml;
+ }
throw;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]