s3-libnetjoin: fix uninitialized variable.
authorGünther Deschner <gd@samba.org>
Thu, 12 May 2011 22:19:13 +0000 (00:19 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 12 May 2011 23:22:18 +0000 (01:22 +0200)
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri May 13 01:22:18 CEST 2011 on sn-devel-104

source3/libnet/libnet_join.c

index 747e1aaadd8ea41ea80b5f668bc873f996dd9dc3..6750120fc990aabdf15ec785b189908131026312 100644 (file)
@@ -1292,7 +1292,7 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
        struct samr_Ids user_rids;
        struct samr_Ids name_types;
        union samr_UserInfo *info = NULL;
-       struct dcerpc_binding_handle *b;
+       struct dcerpc_binding_handle *b = NULL;
 
        ZERO_STRUCT(sam_pol);
        ZERO_STRUCT(domain_pol);
@@ -1433,7 +1433,7 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
        dcerpc_samr_Close(b, mem_ctx, &user_pol, &result);
 
 done:
-       if (pipe_hnd) {
+       if (pipe_hnd && b) {
                if (is_valid_policy_hnd(&domain_pol)) {
                        dcerpc_samr_Close(b, mem_ctx, &domain_pol, &result);
                }