add: if (type_ret!=_XA_MOTIF_WM_HINTS || fmt_ret!=32 || nitems_ret!=PROP_MWM_HINTS_ELEMENTS || !data) return 0;  *mwmhints = malloc(sizeof(MWMHints)); if (!*mwmhints) { XFree(data); return 0; }  (*mwmhints)->flags = data[0]; (*mwmhints)->functions = data[1]; (*mwmhints)->decorations = data[2]; (*mwmhints)->inputMode = data[3];  XFree(data);
context: PropGetMotifWMHints(Window window, MWMHints **mwmhints){    Atom type_ret;    int fmt_ret;    unsigned long nitems_ret;    unsigned long bytes_after_ret;        if (XGetWindowProperty(dpy, window, _XA_MOTIF_WM_HINTS, 0, 20,			   False, _XA_MOTIF_WM_HINTS,			   &type_ret, &fmt_ret, &nitems_ret, &bytes_after_ret,			   (unsigned char **)mwmhints)!=Success)      return 0;    if (type_ret==_XA_MOTIF_WM_HINTS)      return 1;    else       return 0;}