diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-07 17:57:00 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-07 17:57:00 +0000 |
commit | 3ba82448cf800672e1c2aa4dd4a6778154c7e29f (patch) | |
tree | c462e50c247007aca60ae61773b7c12cbafc9cba /fitz | |
parent | 308eeebcdbc6d3dfd3847f0beba27382f6468482 (diff) | |
download | mupdf-3ba82448cf800672e1c2aa4dd4a6778154c7e29f.tar.xz |
Fix fz_close to cope with NULL.
Destructors should accept NULL. This was being tripped in the cleanup
code if a file did not exist.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/stm_open.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fitz/stm_open.c b/fitz/stm_open.c index dfbc42ae..aa99451b 100644 --- a/fitz/stm_open.c +++ b/fitz/stm_open.c @@ -41,6 +41,8 @@ fz_keep_stream(fz_stream *stm) void fz_close(fz_stream *stm) { + if (stm == NULL) + return; stm->refs --; if (stm->refs == 0) { |