[gnome-commander/gcmd-1-6] Checks if char pointer is not null before writing gkey string value, fixes #bgo779574
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-6] Checks if char pointer is not null before writing gkey string value, fixes #bgo779574
- Date: Sun, 5 Mar 2017 20:24:38 +0000 (UTC)
commit 8c5711bb0cddf86d9d372f46d9063dc562fa43fa
Author: Uwe Scholz <uwescholz src gnome org>
Date: Sun Mar 5 21:14:04 2017 +0100
Checks if char pointer is not null before writing gkey string value, fixes #bgo779574
src/gnome-cmd-data.cc | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 7f60aec..bdd3d7d 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1746,16 +1746,20 @@ static void save_fav_apps (const gchar *fname)
if (app)
{
gchar *group_name = g_strdup(gnome_cmd_app_get_name(app));
+ gchar *icon = g_strdup(gnome_cmd_app_get_icon_path(app));
+ if (!icon)
+ icon = g_strdup("");
g_key_file_set_string(key_file,group_name,"cmd",gnome_cmd_app_get_command(app));
- g_key_file_set_string(key_file,group_name,"icon",gnome_cmd_app_get_icon_path(app));
+ g_key_file_set_string(key_file,group_name,"icon", icon);
g_key_file_set_string(key_file,group_name,"pattern",gnome_cmd_app_get_pattern_string(app));
g_key_file_set_integer(key_file,group_name,"target",gnome_cmd_app_get_target(app));
g_key_file_set_integer(key_file,group_name,"handles_uris",gnome_cmd_app_get_handles_uris(app));
g_key_file_set_integer(key_file,group_name,"handles_multiple",gnome_cmd_app_get_handles_multiple(app));
g_key_file_set_integer(key_file,group_name,"requires_terminal",gnome_cmd_app_get_requires_terminal(app));
- g_free (group_name);
+ g_free (icon);
+ g_free (group_name);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]