--- file.c.fixed 2005-12-07 14:21:06.000000000 -0500 +++ file.c 2005-12-07 14:20:46.000000000 -0500 @@ -661,10 +661,16 @@ return 0; bestSize = _XcursorFindBestSize (fileHeader, (XcursorDim) size, &nsize); if (!bestSize) - return 0; + { + _XcursorFileHeaderDestroy (fileHeader); + return 0; + } images = XcursorImagesCreate (nsize); if (!images) - return 0; + { + _XcursorFileHeaderDestroy (fileHeader); + return 0; + } for (n = 0; n < nsize; n++) { toc = _XcursorFindImageToc (fileHeader, bestSize, n);