s3-idmap-ad: Make ad_schema properly talloced
authorVolker Lendecke <vl@samba.org>
Sun, 6 Mar 2011 10:47:19 +0000 (11:47 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 6 Mar 2011 11:51:02 +0000 (12:51 +0100)
source3/winbindd/idmap_ad.c

index 8e7f432f0bc11b1fa3fdaa3eb99b7c15cd86f4a3..1c467980523fd2a257f4bba13f838fed38d7c38e 100644 (file)
@@ -100,7 +100,6 @@ static ADS_STATUS ad_idmap_cached_connection_internal(struct idmap_domain *dom)
                        ads_destroy( &ads );
                        ads_kdestroy(WINBIND_CCACHE_NAME);
                        ctx->ads = NULL;
-                       TALLOC_FREE( ctx->ad_schema );
                }
        }
 
@@ -187,7 +186,8 @@ static ADS_STATUS ad_idmap_cached_connection(struct idmap_domain *dom)
             (ctx->ad_map_type ==  WB_POSIX_MAP_SFU20) ||
             (ctx->ad_map_type ==  WB_POSIX_MAP_RFC2307) )
        {
-               status = ads_check_posix_schema_mapping(NULL, ctx->ads, ctx->ad_map_type, &ctx->ad_schema);
+               status = ads_check_posix_schema_mapping(
+                       ctx, ctx->ads, ctx->ad_map_type, &ctx->ad_schema);
                if ( !ADS_ERR_OK(status) ) {
                        DEBUG(2,("ad_idmap_cached_connection: Failed to obtain schema details!\n"));
                }
@@ -699,8 +699,6 @@ static NTSTATUS idmap_ad_close(struct idmap_domain *dom)
                ctx->ads = NULL;
        }
 
-       TALLOC_FREE( ctx->ad_schema );
-
        return NT_STATUS_OK;
 }