Fixed Svace(memory_leak) accepted/tizen/unified/20191120.130641 submit/tizen/20191120.034939 submit/tizen_5.5/20191120.034924
authorj-h.choi <j-h.choi@samsung.com>
Wed, 20 Nov 2019 01:30:58 +0000 (10:30 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Wed, 20 Nov 2019 01:56:37 +0000 (10:56 +0900)
NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc
NativeLauncher/tool/ni_common.cc
NativeLauncher/tool/tac_common.cc

index 7f75b37..da66f24 100644 (file)
@@ -468,6 +468,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *app
                                        sqlite3_free(sql);
                                        return -1;
                                }
+                               sqlite3_free(sql);
                                if (count == 1) {
                                        sql = sqlite3_mprintf(
                                                "UPDATE TAC SET NAME = %Q, VERSION = %Q, NUGET = %Q WHERE PKGID = %Q AND NAME = %Q;",
@@ -499,6 +500,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *app
                                                        sqlite3_free(sql);
                                                        return -1;
                                                }
+                                               sqlite3_free(sql);
                                                if (count == 1) {
                                                        sql = sqlite3_mprintf(
                                                                "UPDATE TAC SET NAME = %Q, VERSION = %Q, NUGET = %Q WHERE PKGID = %Q AND NAME = %Q;",
index e4d04a5..1aebe55 100644 (file)
@@ -765,6 +765,7 @@ static int regenTacCb(pkgmgrinfo_appinfo_h handle, void *userData)
 
        char *sql = sqlite3_mprintf("SELECT * FROM TAC WHERE PKGID = %Q;", pkgId);
        std::vector<std::string> nugets = dbSelect(tac_db, TAC_APP_LIST_DB, sql);
+       sqlite3_free(sql);
 
        if (tac_db) {
                dbClose(tac_db);
index ce104b8..33d3eb6 100644 (file)
@@ -126,6 +126,7 @@ static int restoreDBCb(pkgmgrinfo_appinfo_h handle, void *userData)
                                "VALUES (%Q, %Q, %Q, %Q);",     pkgId, nuget.c_str(), name.c_str(), version.c_str());
                        dbInsert(tac_db, TAC_APP_LIST_RESTORE_DB, sql);
                        restore_nuget.push_back(concatPath(__TAC_DIR, nuget));
+                       sqlite3_free(sql);
                }
        }
        parserData.clear();