torture: Fix torture_rpc_spoolss_printer_teardown_common().
authorAndreas Schneider <asn@samba.org>
Mon, 10 Dec 2012 12:22:52 +0000 (13:22 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 12 Dec 2012 08:42:33 +0000 (09:42 +0100)
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/rpc/spoolss.c

index 6e0d9edcf888273b5114115e1fbeb3937c4bc981..b1229ac3aab836e54e49ffdb6afa65a7883d754f 100644 (file)
@@ -7646,11 +7646,9 @@ static bool torture_rpc_spoolss_printer_teardown_common(struct torture_context *
                        "failed to remove printer driver");
        }
 
-       if (p) {
+       if (p && !t->wellknown) {
                b = p->binding_handle;
-       }
 
-       if (!t->wellknown) {
                torture_assert(tctx,
                        test_DeletePrinter(tctx, b, &t->handle),
                        "failed to delete printer");