summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/netapi.c2
-rw-r--r--source3/lib/netapi/netapi_private.h1
-rw-r--r--source3/lib/netapi/samr.c19
3 files changed, 22 insertions, 0 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c
index 2cc636ffb7..7d78aa8120 100644
--- a/source3/lib/netapi/netapi.c
+++ b/source3/lib/netapi/netapi.c
@@ -153,6 +153,8 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
return NET_API_STATUS_SUCCESS;
}
+ libnetapi_samr_free(ctx);
+
libnetapi_shutdown_cm(ctx);
if (ctx->krb5_cc_env) {
diff --git a/source3/lib/netapi/netapi_private.h b/source3/lib/netapi/netapi_private.h
index 37c837d897..915d60617f 100644
--- a/source3/lib/netapi/netapi_private.h
+++ b/source3/lib/netapi/netapi_private.h
@@ -70,5 +70,6 @@ void libnetapi_samr_close_builtin_handle(struct libnetapi_ctx *ctx,
struct policy_handle *handle);
void libnetapi_samr_close_connect_handle(struct libnetapi_ctx *ctx,
struct policy_handle *handle);
+void libnetapi_samr_free(struct libnetapi_ctx *ctx);
#endif
diff --git a/source3/lib/netapi/samr.c b/source3/lib/netapi/samr.c
index 19cf6cb338..dbcef38dc7 100644
--- a/source3/lib/netapi/samr.c
+++ b/source3/lib/netapi/samr.c
@@ -298,3 +298,22 @@ void libnetapi_samr_close_connect_handle(struct libnetapi_ctx *ctx,
ZERO_STRUCT(priv->samr.connect_handle);
}
+
+/****************************************************************
+****************************************************************/
+
+void libnetapi_samr_free(struct libnetapi_ctx *ctx)
+{
+ struct libnetapi_private_ctx *priv;
+
+ if (!ctx->private_data) {
+ return;
+ }
+
+ priv = talloc_get_type_abort(ctx->private_data,
+ struct libnetapi_private_ctx);
+
+ libnetapi_samr_close_domain_handle(ctx, &priv->samr.domain_handle);
+ libnetapi_samr_close_builtin_handle(ctx, &priv->samr.builtin_handle);
+ libnetapi_samr_close_connect_handle(ctx, &priv->samr.connect_handle);
+}