diff options
author | Pablo Barciela <[email protected]> | 2019-02-23 19:00:46 +0100 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2019-03-05 01:19:53 +0100 |
commit | 7c9ae01aaee4583eb0ca979dc3a07b6ae585a90d (patch) | |
tree | 68e678048461eb1e069354b3d383114758dccf83 /src/caja-information-panel.c | |
parent | 7b605dd4d10b44aa8fd998d75dc2862edeea8629 (diff) | |
download | caja-7c9ae01aaee4583eb0ca979dc3a07b6ae585a90d.tar.bz2 caja-7c9ae01aaee4583eb0ca979dc3a07b6ae585a90d.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); } |