diff options
-rw-r--r-- | src/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |