prevent potential fclose(NULL) in error path of diff_blobs()
diff --git a/lib/diff.c b/lib/diff.c
index a1db0da..28c6046 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -85,7 +85,8 @@ diff_blobs(off_t **line_offsets, size_t *nlines,
f2 = got_opentemp();
if (f2 == NULL) {
err = got_error_from_errno("got_opentemp");
- fclose(f1);
+ if (f1)
+ fclose(f1);
return err;
}
}