memory corruption in xfpm_dbus_monitor_add_unique_name
/usr/bin/valgrind --tool=memcheck --error-limit=no --log-file=/dev/shm/valgrind.memcheck.xfce4-power-manager.bin.%p.%n.txt --show-leak-kinds=all --leak-check=full --malloc-fill=0xa5 --free-fill=0x5a /usr/bin/xfce4-power-manager.bin
==2327== Memcheck, a memory error detector
==2327== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2327== Using Valgrind-3.18.0.GIT and LibVEX; rerun with -h for copyright info
==2327== Command: /usr/bin/xfce4-power-manager.bin
==2327== Parent PID: 1605
==2327==
==2327== Invalid read of size 8
==2327== at 0x12BCEE: xfpm_dbus_monitor_free_watch_data (xfpm-dbus-monitor.c:77)
==2327== by 0x12BCEE: xfpm_dbus_monitor_remove_unique_name (xfpm-dbus-monitor.c:337)
==2327== by 0x123640: xfpm_inhibit_remove_application_by_cookie (xfpm-inhibit.c:184)
==2327== by 0x123640: xfpm_inhibit_un_inhibit (xfpm-inhibit.c:425)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== by 0x1183B0: _xfpm_power_management_inhibit_skeleton_handle_method_call (org.freedesktop.PowerManagement.Inhibit.c:1477)
==2327== by 0x6B144A6: g_dbus_interface_method_dispatch_helper (gdbusinterfaceskeleton.c:609)
==2327== by 0x6AFC4AB: call_in_idle_cb (gdbusconnection.c:4851)
==2327== by 0x72A0886: g_idle_dispatch (gmain.c:5486)
==2327== Address 0x170cb750 is 0 bytes inside a block of size 16 free'd
==2327== at 0x4C320AB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2327== by 0x72A984D: g_free (gmem.c:189)
==2327== by 0x727752D: g_ptr_array_remove_index (garray.c:1206)
==2327== by 0x7277950: g_ptr_array_remove (garray.c:1339)
==2327== by 0x12BCED: xfpm_dbus_monitor_remove_unique_name (xfpm-dbus-monitor.c:336)
==2327== by 0x123640: xfpm_inhibit_remove_application_by_cookie (xfpm-inhibit.c:184)
==2327== by 0x123640: xfpm_inhibit_un_inhibit (xfpm-inhibit.c:425)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== Block was alloc'd at
==2327== at 0x4C34531: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2327== by 0x72A9790: g_malloc0 (gmem.c:124)
==2327== by 0x12BC51: xfpm_dbus_monitor_add_unique_name (xfpm-dbus-monitor.c:318)
==2327== by 0x123779: xfpm_inhibit_inhibit (xfpm-inhibit.c:408)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== by 0x1183B0: _xfpm_power_management_inhibit_skeleton_handle_method_call (org.freedesktop.PowerManagement.Inhibit.c:1477)
==2327== by 0x6B144A6: g_dbus_interface_method_dispatch_helper (gdbusinterfaceskeleton.c:609)
==2327==
==2327== Invalid free() / delete / delete[] / realloc()
==2327== at 0x4C320AB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2327== by 0x72A984D: g_free (gmem.c:189)
==2327== by 0x12BCF6: xfpm_dbus_monitor_free_watch_data (xfpm-dbus-monitor.c:77)
==2327== by 0x12BCF6: xfpm_dbus_monitor_remove_unique_name (xfpm-dbus-monitor.c:337)
==2327== by 0x123640: xfpm_inhibit_remove_application_by_cookie (xfpm-inhibit.c:184)
==2327== by 0x123640: xfpm_inhibit_un_inhibit (xfpm-inhibit.c:425)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== by 0x1183B0: _xfpm_power_management_inhibit_skeleton_handle_method_call (org.freedesktop.PowerManagement.Inhibit.c:1477)
==2327== by 0x6B144A6: g_dbus_interface_method_dispatch_helper (gdbusinterfaceskeleton.c:609)
==2327== Address 0x5a5a5a5a5a5a5a5a is not stack'd, malloc'd or (recently) free'd
==2327==
==2327== Invalid free() / delete / delete[] / realloc()
==2327== at 0x4C320AB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2327== by 0x72A984D: g_free (gmem.c:189)
==2327== by 0x123640: xfpm_inhibit_remove_application_by_cookie (xfpm-inhibit.c:184)
==2327== by 0x123640: xfpm_inhibit_un_inhibit (xfpm-inhibit.c:425)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== by 0x1183B0: _xfpm_power_management_inhibit_skeleton_handle_method_call (org.freedesktop.PowerManagement.Inhibit.c:1477)
==2327== by 0x6B144A6: g_dbus_interface_method_dispatch_helper (gdbusinterfaceskeleton.c:609)
==2327== by 0x6AFC4AB: call_in_idle_cb (gdbusconnection.c:4851)
==2327== Address 0x170cb750 is 0 bytes inside a block of size 16 free'd
==2327== at 0x4C320AB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2327== by 0x72A984D: g_free (gmem.c:189)
==2327== by 0x727752D: g_ptr_array_remove_index (garray.c:1206)
==2327== by 0x7277950: g_ptr_array_remove (garray.c:1339)
==2327== by 0x12BCED: xfpm_dbus_monitor_remove_unique_name (xfpm-dbus-monitor.c:336)
==2327== by 0x123640: xfpm_inhibit_remove_application_by_cookie (xfpm-inhibit.c:184)
==2327== by 0x123640: xfpm_inhibit_un_inhibit (xfpm-inhibit.c:425)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== Block was alloc'd at
==2327== at 0x4C34531: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2327== by 0x72A9790: g_malloc0 (gmem.c:124)
==2327== by 0x12BC51: xfpm_dbus_monitor_add_unique_name (xfpm-dbus-monitor.c:318)
==2327== by 0x123779: xfpm_inhibit_inhibit (xfpm-inhibit.c:408)
==2327== by 0xD5C06CC: ffi_call_unix64 (unix64.S:101)
==2327== by 0xD5BFBDE: ffi_call_int (ffi64.c:662)
==2327== by 0x7013153: g_cclosure_marshal_generic (gclosure.c:1490)
==2327== by 0x70128CC: g_closure_invoke (gclosure.c:804)
==2327== by 0x7025A7D: signal_emit_unlocked_R (gsignal.c:3635)
==2327== by 0x702D85F: g_signal_emitv (gsignal.c:3129)
==2327== by 0x1183B0: _xfpm_power_management_inhibit_skeleton_handle_method_call (org.freedesktop.PowerManagement.Inhibit.c:1477)
==2327== by 0x6B144A6: g_dbus_interface_method_dispatch_helper (gdbusinterfaceskeleton.c:609)
==2327==