Branch: refs/heads/master Author: Avinash Sonawane rootkea@gmail.com Committer: GitHub noreply@github.com Date: Wed, 27 Oct 2021 23:46:52 UTC Commit: 04566236d3f9811d55d6c7bcc492b3a60369fd20 https://github.com/geany/geany/commit/04566236d3f9811d55d6c7bcc492b3a60369fd...
Log Message: ----------- Free `accel_string` only after its last use (#2961)
Found by: scan-build
Modified Paths: -------------- src/editor.c
Modified: src/editor.c 4 lines changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -222,13 +222,15 @@ static void add_kb(GKeyFile *keyfile, const gchar *group, gchar **keys) gchar *accel_string = g_key_file_get_value(keyfile, group, keys[i], NULL);
gtk_accelerator_parse(accel_string, &key, &mods); - g_free(accel_string);
if (key == 0 && mods == 0) { g_warning("Can not parse accelerator "%s" from user snippets.conf", accel_string); + g_free(accel_string); continue; } + g_free(accel_string); + gtk_accel_group_connect(snippet_accel_group, key, mods, 0, g_cclosure_new_swap((GCallback)on_snippet_keybinding_activate, g_strdup(keys[i]), (GClosureNotify)g_free));
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).