s3-printing: fix crash bug in print_spool_open().
authorGünther Deschner <gd@samba.org>
Wed, 22 Dec 2010 10:34:22 +0000 (11:34 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 22 Dec 2010 13:21:58 +0000 (14:21 +0100)
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Dec 22 14:21:58 CET 2010 on sn-devel-104

source3/printing/printspoolss.c

index 8426b84fec501a4ef5a839a7d579e4e0f5f4692e..8effb6ec482eb59d872bf923fd602d54f41f4445 100644 (file)
@@ -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) {