summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/file.c b/src/file.c
index 631d8f8..efe6d4b 100644
--- a/src/file.c
+++ b/src/file.c
@@ -975,10 +975,13 @@ XcursorFileLoad (FILE *file,
XcursorBool
XcursorFileSaveImages (FILE *file, const XcursorImages *images)
{
- XcursorComments *comments = XcursorCommentsCreate (0);
+ XcursorComments *comments;
XcursorFile f;
XcursorBool ret;
- if (!comments || !file || !images)
+
+ if (!file || !images)
+ return 0;
+ if ((comments = XcursorCommentsCreate (0)) == NULL)
return 0;
_XcursorStdioFileInitialize (file, &f);
ret = XcursorXcFileSave (&f, comments, images) && fflush (file) != EOF;