summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/file.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/file.c b/src/file.c
index de17004..368961b 100644
--- a/src/file.c
+++ b/src/file.c
@@ -655,16 +655,22 @@ XcursorXcFileLoadImages (XcursorFile *file, int size)
int toc;
if (!file || size < 0)
- return 0;
+ return NULL;
fileHeader = _XcursorReadFileHeader (file);
if (!fileHeader)
- return 0;
+ return NULL;
bestSize = _XcursorFindBestSize (fileHeader, (XcursorDim) size, &nsize);
if (!bestSize)
- return 0;
+ {
+ _XcursorFileHeaderDestroy (fileHeader);
+ return NULL;
+ }
images = XcursorImagesCreate (nsize);
if (!images)
- return 0;
+ {
+ _XcursorFileHeaderDestroy (fileHeader);
+ return NULL;
+ }
for (n = 0; n < nsize; n++)
{
toc = _XcursorFindImageToc (fileHeader, bestSize, n);