summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/printing/printspoolss.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/printing/printspoolss.c b/source3/printing/printspoolss.c
index 8426b84fec..8effb6ec48 100644
--- a/source3/printing/printspoolss.c
+++ b/source3/printing/printspoolss.c
@@ -208,7 +208,9 @@ done:
if (!NT_STATUS_IS_OK(status)) {
if (fd != -1) {
close(fd);
- unlink(fsp->print_file->filename);
+ if (fsp->print_file) {
+ unlink(fsp->print_file->filename);
+ }
}
/* We need to delete the job from spoolss too */
if (pf->jobid) {