s3-netapi: Fix Coverity #669 FORWARD_NULL.
authorGünther Deschner <gd@samba.org>
Wed, 16 Sep 2009 08:26:28 +0000 (10:26 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 16 Sep 2009 08:30:01 +0000 (10:30 +0200)
Guenthe

source3/lib/netapi/user.c

index e23587d6aa4b6f826569dfaed6a3b41e8f0aa175..f56d433614846e3bf3b5a86fca5a2028c551d419 100644 (file)
@@ -466,7 +466,7 @@ WERROR NetUserAdd_r(struct libnetapi_ctx *ctx,
                               &user_handle);
 
  done:
                               &user_handle);
 
  done:
-       if (is_valid_policy_hnd(&user_handle)) {
+       if (is_valid_policy_hnd(&user_handle) && pipe_cli) {
                rpccli_samr_Close(pipe_cli, ctx, &user_handle);
        }
 
                rpccli_samr_Close(pipe_cli, ctx, &user_handle);
        }