update: Stop using evil g_build_path

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
Ikey Doherty
2016-01-11 18:44:18 +00:00
parent 174bb08f54
commit f4ea02368a
+4 -3
View File
@@ -51,7 +51,7 @@ gchar *get_db_path(const gchar *path)
if (!path || !*path) {
const gchar *home = g_get_home_dir();
dir = g_build_path(G_DIR_SEPARATOR_S, home, nvd_dir, NULL);
dir = g_strdup_printf("%s/%s", home, nvd_dir);
} else {
dir = (gchar *) path;
}
@@ -66,10 +66,11 @@ gchar *get_db_path(const gchar *path)
goto end;
}
ret = g_build_path(G_DIR_SEPARATOR_S, dir, nvd_file, NULL);
ret = g_strdup_printf("%s/%s", dir, nvd_file);
end:
if (dir != path)
if (dir != path) {
g_free(dir);
}
return ret;
}