codecanalyzer: don't try to free uninitialized pointers

xml_files_path and hex_files_path variable are not initialized.
There are chances that corruption happens when uninitialized
variables are freed, so init them to NULL before use.

https://bugzilla.gnome.org/show_bug.cgi?id=748351
This commit is contained in:
Vineeth T M 2015-04-23 15:53:12 +09:00 committed by Tim-Philipp Müller
parent f700eaef8f
commit 1f58db52bf

View file

@ -960,15 +960,13 @@ static gboolean
analyzer_create_dirs ()
{
const gchar *user_cache_dir;
gchar *xml_files_path;
gchar *hex_files_path;
gchar *xml_files_path = NULL;
gchar *hex_files_path = NULL;
gboolean ret = TRUE;
user_cache_dir = g_get_user_cache_dir ();
if (!user_cache_dir) {
ret = FALSE;
goto done;
}
if (!user_cache_dir)
return FALSE;
ui->analyzer_home = g_build_filename (user_cache_dir, "codecanalyzer", NULL);