[Filesystem] CreateFile() return in case of error.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 9 Jun 2015 07:24:50 +0000 (09:24 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 9 Jun 2015 07:24:50 +0000 (09:24 +0200)
Prevent CID: 406692

[Verification] TCT pass rate: 289/289

Change-Id: I1b8ec74e59a3355f82e3a37a1d2c42e1d8b05149
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/filesystem/filesystem_manager.cc

index 78f469da6a275ee9a320a942d41455473b5d5482..88594261acb36cd1a7d1145be50a9d0805ba03c3 100755 (executable)
@@ -276,11 +276,13 @@ void FilesystemManager::CreateFile(
   if (-1 == status) {
     LoggerE("Cannot create or open file %s: %s", path.c_str(), strerror(errno));
     error_cb(FilesystemError::Other);
+    return;
   }
   status = close(status);
   if (0 != status) {
     LoggerE("Cannot close file %s: %s", path.c_str(), strerror(errno));
     error_cb(FilesystemError::Other);
+    return;
   }
   FilesystemStat stat = FilesystemStat::getStat(path);
   if (stat.valid) {