mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcursor.git
synced 2026-04-03 11:30:48 +02:00
Fix memory leak in _XcursorXcFileLoadImage
fileHeader needs to be freed in the two early returns
This commit is contained in:
parent
a99d7dea96
commit
f3305d7922
1 changed files with 6 additions and 0 deletions
|
|
@ -761,10 +761,16 @@ _XcursorXcFileLoadImage (XcursorFile *file, int size, XcursorBool resize)
|
|||
returnAddr(NULL);
|
||||
bestSize = _XcursorFindBestSize (fileHeader, (XcursorDim) size, &nsize);
|
||||
if (!bestSize)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
returnAddr(NULL);
|
||||
}
|
||||
toc = _XcursorFindImageToc (fileHeader, bestSize, 0);
|
||||
if (toc < 0)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
returnAddr(NULL);
|
||||
}
|
||||
image = _XcursorReadImage (file, fileHeader, toc);
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue