from the man-page of XF86VidModeGetMonitor:
Information known to the server about the monitor is returned by the XF
function. The hsync and vsync fields each point to an array of XF86VidMo
tures. The arrays contain nhsync and nvsync elements, respectively. Th
will be equal if a discreate value was given in the XF86Config file.
The vendor, model, hsync, and vsync fields point to dynamically alloc
should be freed by the caller.
dynamically allocated ??
_XReadPad(dpy, monitor->vendor, rep.vendorLength);
monitor->vendor = "";
_XReadPad(dpy, monitor->model, rep.modelLength);
monitor->model = "";
a pointer to a static "" is not dynamically!!
XF86VidModeGetMonitor(dpy, DefaultScreen(dpy), &monitor)
XFree(monitor.vendor); -> crash
XFree(monitor.model); -> crash
were does the problem arise: xdpyinfo
XFree86-VidModeExtension version 2.2 opcode: 134, base error: 130
Vendor: , Model:
Num hsync: 1, Num vsync: 1
hsync range 0: 30.00 - 70.00
vsync range 0: 47.00 - 85.00
*** glibc detected *** ./xdpyinfo: munmap_chunk(): invalid pointer: 0xb7ec794
Fixed in git, thanks!