summaryrefslogtreecommitdiff
path: root/src/caja-information-panel.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-02-23 19:00:46 +0100
committerZenWalker <[email protected]>2019-03-04 12:52:36 +0100
commit961af3468a5ac1e17f6af93c490093a7e6e431ae (patch)
tree0e1de245f6caeff4b5af076cbd41bd7751e08945 /src/caja-information-panel.c
parent372f21aea76e7119e4a313b73e4f08374b0d4fc4 (diff)
downloadcaja-961af3468a5ac1e17f6af93c490093a7e6e431ae.tar.bz2
caja-961af3468a5ac1e17f6af93c490093a7e6e431ae.tar.xz
caja-information-panel: Fix use of memory after it is freed
to avoid warning with Clang Analyzer
Diffstat (limited to 'src/caja-information-panel.c')
-rw-r--r--src/caja-information-panel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c
index e91ca103..d4a22df4 100644
--- a/src/caja-information-panel.c
+++ b/src/caja-information-panel.c
@@ -945,6 +945,9 @@ add_buttons_from_metadata (CajaInformationPanel *information_panel, const char *
*temp_str = '\0';
if (!g_ascii_strcasecmp (current_term, "button"))
{
+ if (button_name)
+ g_free (button_name);
+
button_name = g_strdup (temp_str + 1);
}
else if (!g_ascii_strcasecmp (current_term, "script"))
@@ -958,7 +961,6 @@ add_buttons_from_metadata (CajaInformationPanel *information_panel, const char *
0);
information_panel->details->has_buttons = TRUE;
command_string = g_strdup (temp_str + 1);
- g_free (button_name);
g_signal_connect_data (temp_button,
"clicked",
@@ -975,6 +977,7 @@ add_buttons_from_metadata (CajaInformationPanel *information_panel, const char *
}
g_free(current_term);
}
+ g_free (button_name);
g_strfreev (terms);
}