The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

comp: Don't leak xcb replies.

According the XCB documentation the reply structs must be freed. I found
this when running a minimal example related to the direct mode code in
valgrind.

+15
+10
src/xrt/compositor/main/comp_window_direct_mode.cpp
··· 762 762 COMP_DEBUG(w->base.c, "RandR version below 1.6."); 763 763 } 764 764 765 + free(version_reply); 766 + 765 767 xcb_generic_error_t *error = nullptr; 766 768 xcb_intern_atom_cookie_t non_desktop_cookie = xcb_intern_atom( 767 769 w->connection, 1, strlen("non-desktop"), "non-desktop"); ··· 811 813 // Only outputs with an available mode should be used 812 814 // (it is possible to see 'ghost' outputs with non-desktop=1). 813 815 if (output_reply->num_modes == 0) { 816 + free(output_reply); 814 817 continue; 815 818 } 816 819 ··· 836 839 "returned error %d", 837 840 error->error_code); 838 841 free(name_str); 842 + free(prop_reply); 839 843 continue; 840 844 } 841 845 842 846 if (prop_reply == nullptr) { 843 847 COMP_ERROR(w->base.c, "property reply == nullptr"); 844 848 free(name_str); 849 + free(prop_reply); 845 850 continue; 846 851 } 847 852 ··· 849 854 prop_reply->num_items != 1 || prop_reply->format != 32) { 850 855 COMP_ERROR(w->base.c, "Invalid non-desktop reply"); 851 856 free(name_str); 857 + free(prop_reply); 852 858 continue; 853 859 } 854 860 ··· 884 890 w->randr_displays.push_back(d); 885 891 } 886 892 893 + free(prop_reply); 894 + free(output_reply); 887 895 free(name_str); 888 896 } 897 + 898 + free(resources_reply); 889 899 } 890 900 891 901 static void
+5
src/xrt/compositor/main/comp_window_xcb.cpp
··· 301 301 if (output_reply->connection != 302 302 XCB_RANDR_CONNECTION_CONNECTED || 303 303 output_reply->crtc == XCB_NONE) { 304 + free(output_reply); 304 305 continue; 305 306 } 306 307 ··· 325 326 d.size = {crtc_reply->width, crtc_reply->height}; 326 327 w->displays.push_back(d); 327 328 329 + free(crtc_reply); 330 + free(output_reply); 328 331 free(name_str); 329 332 } 333 + 334 + free(resources_reply); 330 335 } 331 336 332 337 static void