Commit 72a46499 authored by David King's avatar David King Committed by Paolo Bacchilega

Fix memory leak in fr_window_change_action_state

Found with Valgrind:

==9376== 81 (40 direct, 41 indirect) bytes in 1 blocks are definitely
lost in loss record 12,551 of 17,916
==9376==    at 0x4C2BC50: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==9376==    by 0x748B689: g_malloc (gmem.c:97)
==9376==    by 0x74A24D2: g_slice_alloc (gslice.c:1007)
==9376==    by 0x74C022C: g_variant_alloc (gvariant-core.c:476)
==9376==    by 0x74C022C: g_variant_new_from_bytes (gvariant-core.c:512)
==9376==    by 0x74B9766: g_variant_new_from_trusted (gvariant.c:295)
==9376==    by 0x74B97DE: g_variant_new_boolean (gvariant.c:316)
==9376==    by 0x43CACD: fr_window_change_action_state.constprop.63
(fr-window.c:724)
==9376==    by 0x43CC96: fr_window_deactivate_filter (fr-window.c:1712)
==9376==    by 0x43CC96: fr_window_update_current_location
(fr-window.c:1738)
==9376==    by 0x441583: fr_window_construct (fr-window.c:5748)
==9376==    by 0x441583: fr_window_new (fr-window.c:5796)
==9376==    by 0x41C490: fr_application_command_line
(fr-application.c:588)
==9376==    by 0xC750D2F: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==9376==    by 0xC75079A: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==9376==    by 0x71FAB94: g_cclosure_marshal_generic_va
(gclosure.c:1594)
==9376==    by 0x71FA0C3: _g_closure_invoke_va (gclosure.c:864)
==9376==    by 0x7213DD8: g_signal_emit_valist (gsignal.c:3246)
==9376==    by 0x72148F1: g_signal_emit (gsignal.c:3393)
==9376==    by 0x6F0CF82: g_application_call_command_line
(gapplication.c:953)
==9376==    by 0x6F0F55F: g_application_run (gapplication.c:2292)
==9376==    by 0x414FE5: main (main.c:38)

https://bugzilla.gnome.org/show_bug.cgi?id=752476
parent 6022be01
......@@ -709,6 +709,8 @@ fr_window_change_action_state (FrWindow *window,
new_state = g_variant_new_boolean (value);
if ((old_state == NULL) || ! g_variant_equal (old_state, new_state))
g_action_change_state (action, new_state);
else
g_variant_unref (new_state);
if (old_state != NULL)
g_variant_unref (old_state);
......
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