Skip to content
Permalink
Browse files

caja-information-panel: Fix use of memory after it is freed

to avoid warning with Clang Analyzer
  • Loading branch information...
sc0w committed Feb 23, 2019
1 parent 7b605dd commit 7c9ae01aaee4583eb0ca979dc3a07b6ae585a90d
Showing with 4 additions and 1 deletion.
  1. +4 −1 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);
}

0 comments on commit 7c9ae01

Please sign in to comment.
You can’t perform that action at this time.