summaryrefslogtreecommitdiff
path: root/fitz/stm_open.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-07 17:57:00 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-07 17:57:00 +0000
commit3ba82448cf800672e1c2aa4dd4a6778154c7e29f (patch)
treec462e50c247007aca60ae61773b7c12cbafc9cba /fitz/stm_open.c
parent308eeebcdbc6d3dfd3847f0beba27382f6468482 (diff)
downloadmupdf-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/stm_open.c')
-rw-r--r--fitz/stm_open.c2
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)
{