diff options
author | Pablo Barciela <[email protected]> | 2019-02-23 19:00:46 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2019-03-04 12:52:36 +0100 |
commit | 961af3468a5ac1e17f6af93c490093a7e6e431ae (patch) | |
tree | 0e1de245f6caeff4b5af076cbd41bd7751e08945 /src/caja-information-panel.c | |
parent | 372f21aea76e7119e4a313b73e4f08374b0d4fc4 (diff) | |
download | caja-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.c | 5 |
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); } |