Fix return type of _get_db_path 98/71998/2
authorSangyoon Jang <s89.jang@samsung.com>
Mon, 30 May 2016 06:42:47 +0000 (15:42 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 1 Jun 2016 02:16:30 +0000 (19:16 -0700)
Changed to 'const char *' from 'char *'.

Change-Id: I69ae01483899c646ec28b2c27f6a6c059635411f
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
parser/widget_plugin_parser_internal.c

index 1a811e8..dc424eb 100644 (file)
@@ -89,7 +89,7 @@ static int _is_global(uid_t uid)
                return 0;
 }
 
-static char *_get_db_path(uid_t uid)
+static const char *_get_db_path(uid_t uid)
 {
        const char *path;
 
@@ -101,14 +101,14 @@ static char *_get_db_path(uid_t uid)
 
        tzplatform_reset_user();
 
-       return strdup(path);
+       return path;
 }
 
 sqlite3 *_open_db(uid_t uid, bool readonly)
 {
        int ret;
        sqlite3 *db;
-       char *path;
+       const char *path;
 
        path = _get_db_path(uid);
 
@@ -122,19 +122,15 @@ sqlite3 *_open_db(uid_t uid, bool readonly)
                        NULL);
        if (ret != SQLITE_OK) {
                LOGE("open db(%s) error: %d", path, ret);
-               free(path);
                return NULL;
        }
 
        /* turn on foreign keys */
        if (sqlite3_exec(db, "PRAGMA foreign_keys = ON", NULL, NULL, NULL)) {
-               free(path);
                sqlite3_close_v2(db);
                return NULL;
        }
 
-       free(path);
-
        return db;
 }