Fix static analyzer issues 14/114314/1 accepted/tizen/3.0/common/20170214.180722 accepted/tizen/3.0/ivi/20170214.092327 accepted/tizen/3.0/mobile/20170214.092110 accepted/tizen/3.0/tv/20170214.092225 accepted/tizen/3.0/wearable/20170214.092300 submit/tizen_3.0/20170213.113017
authorSangyoon Jang <s89.jang@samsung.com>
Mon, 13 Feb 2017 02:00:37 +0000 (11:00 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Mon, 13 Feb 2017 02:37:35 +0000 (18:37 -0800)
Change-Id: I3eab39f1c84b0b96d91834f0da8b5bf75394321f
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
(cherry picked from commit 57aa1da804676bb787363e8f0c0b0005fc01ef26)

src/common/recovery_file.cc
src/common/utils/file_util.cc

index 9d35299..4d988b8 100644 (file)
@@ -82,7 +82,7 @@ std::unique_ptr<RecoveryFile> RecoveryFile::OpenRecoveryFileForPath(
 }
 
 RecoveryFile::RecoveryFile(const bf::path& path, bool load)
-    : path_(path) {
+    : type_(RequestType::Unknown), path_(path) {
   if (load) {
     if (!ReadFileContent()) {
       path_.clear();
index 7935e9e..2a1f380 100644 (file)
@@ -473,6 +473,7 @@ bool ExtractToTmpDir(const char* zip_path, const bf::path& tmp_dir,
           ret = unzReadCurrentFile(zip_file.Get(), read_buffer, kZipBufSize);
           if (ret < 0) {
             LOG(ERROR) << "Failed to read data: " << ret;
+            fclose(out);
             return false;
           } else {
             fwrite(read_buffer, sizeof(char), ret, out);