Skip to content

display-settings: Fix XfceMode leak

Leak report

Direct leak of 416 byte(s) in 2 object(s) allocated from:
    #0 0x566d59e15979 in malloc (/usr/asan/bin/xfce4-display-settings+0x1ff979)
    #1 0x7f67399d5282 in g_malloc glib/gmem.c:100:13
    #2 0x7f67399d5282 in g_malloc_n glib/gmem.c:410:10
    #3 0x566d59e92e3e in xfce_display_settings_x11_get_output xfce4-settings/dialogs/display-settings/display-settings-x11.c:490:21
    #4 0x566d59e87dd7 in xfce_display_settings_set_outputs xfce4-settings/dialogs/display-settings/display-settings.c:253:30
    #5 0x566d59e8afb5 in xfce_display_settings_reload xfce4-settings/dialogs/display-settings/display-settings.c:668:9
    #6 0x566d59e8fc66 in screen_on_event xfce4-settings/dialogs/display-settings/display-settings-x11.c:201:5
    #7 0x7f673a3cf444 in gdk_event_apply_filters gdk/x11/gdkeventsource.c:79:16
    #8 0x7f673a3cf444 in gdk_event_source_translate_event gdk/x11/gdkeventsource.c:205:16
    #9 0x7f673a3cf444 in _gdk_x11_display_queue_events gdk/x11/gdkeventsource.c:341:15
    #10 0x7f673a306aa2 in gdk_display_get_event gdk/gdkdisplay.c:442:5
    #11 0x7f673a3d0119 in gdk_event_source_dispatch gdk/x11/gdkeventsource.c:363:11
    #12 0x7f67399c1102 in g_main_dispatch glib/gmain.c:3357:27
[...snip...]

Steps to reproduce

  • Run xfce4-display-settings and change your screen resolution

Testing

  • No issues were detected with LSan, ASan, or Valgrind when testing the patch
  • I verified that I can still change and revert my screen resolution

Merge request reports