Some files were opened not closed in XBoard, when loading XIM images
(which I doubt anyone ever does) but also when copying the clipboard
(which has the potential of being done very often). There was also some
code that would not work if conditional code which is permanently
disabled would be enabled.
/* create Pixmap of piece */
*dest = XCreatePixmap(xDisplay, DefaultRootWindow(xDisplay),
w, h, xim->depth);
/* create Pixmap of piece */
*dest = XCreatePixmap(xDisplay, DefaultRootWindow(xDisplay),
w, h, xim->depth);
XTranslateCoordinates(xDisplay, XtWindow(shellWidget),
RootWindowOfScreen(XtScreen(shellWidget)),
(bw_width - w) / 2, 0 - h / 2, &xx, &yy, &junk);
XTranslateCoordinates(xDisplay, XtWindow(shellWidget),
RootWindowOfScreen(XtScreen(shellWidget)),
(bw_width - w) / 2, 0 - h / 2, &xx, &yy, &junk);
if (y < 0) y = 0; /*avoid positioning top offscreen*/
j = 0;
if (y < 0) y = 0; /*avoid positioning top offscreen*/
j = 0;
rewind(f);
selection_tmp = XtMalloc(len + 1);
count = fread(selection_tmp, 1, len, f);
rewind(f);
selection_tmp = XtMalloc(len + 1);
count = fread(selection_tmp, 1, len, f);
if (len != count) {
XtFree(selection_tmp);
return False;
if (len != count) {
XtFree(selection_tmp);
return False;