Fix svace issues 49/257949/2 accepted/tizen/unified/20210509.123847 submit/tizen/20210507.080545
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 7 May 2021 04:17:41 +0000 (13:17 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 7 May 2021 04:18:31 +0000 (13:18 +0900)
- MEMORY_LEAK
- INCORRECT_PERMISSION

Change-Id: I6b168f48652ac879b80f777d4c711abedf9c7806

src/download-mgr-main.cpp
src/download-mgr-util.cpp

index f258fec..72e1c82 100644 (file)
@@ -332,6 +332,7 @@ static void __app_control(app_control_h s, void *data)
                        unsigned int id = (int) strtol(historyid_str, &end_ptr, 0);
                        if (ERANGE == errno) {
                                DM_LOGE("HistoryId String conversion failed");
+                               free(historyid_str);
                                return;
                        }
                        DM_LOGI("History Id from downloading noti[%s]", historyid_str);
index aeb8006..4cc8446 100644 (file)
@@ -339,7 +339,7 @@ bool FileUtility::checkTempDir(string userInstallDir)
 
        DM_SLOGD("temp dir:[%s]", defaultDir.c_str());
        if (!isExistedFile(defaultDir, true)) {
-               if (mkdir(defaultDir.c_str(), 755)) {
+               if (mkdir(defaultDir.c_str(), 644)) {
                        DM_LOGE("Fail to create directory");
                        return false;
                } else {