Commit 80ceeb28 authored by Benjamin Berg's avatar Benjamin Berg Committed by Georges Basile Stavracas Neto

keybindings: Fix theoretical memory leak while ungrabbing

In the unlikely event that one tries to ungrab an action which does not
exist, a small leak could occur. Fix this by using g_autofree.

parent 15740994
Pipeline #67384 passed with stages
in 3 minutes and 39 seconds
......@@ -1654,7 +1654,7 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
MetaKeyBindingManager *keys = &display->key_binding_manager;
MetaKeyBinding *binding;
MetaKeyGrab *grab;
char *key;
g_autofree char *key = NULL;
MetaResolvedKeyCombo resolved_combo = { NULL, 0 };
g_return_val_if_fail (action != META_KEYBINDING_ACTION_NONE, FALSE);
......@@ -1683,7 +1683,6 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
g_hash_table_remove (external_grabs, key);
g_free (key);
resolved_key_combo_reset (&resolved_combo);
return TRUE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment