summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-07-17 19:06:02 +0200
committerGünther Deschner <gd@samba.org>2008-07-18 16:52:42 +0200
commit352d40c0664919530f394c83fbbb7eb53adb1f31 (patch)
tree299944c43c20f86e286ff0f750eb58a36f8f2f61
parentbbdf38d1d73e0424c3b4a6ee27c11b6751af2582 (diff)
downloadsamba-352d40c0664919530f394c83fbbb7eb53adb1f31.tar.gz
samba-352d40c0664919530f394c83fbbb7eb53adb1f31.tar.bz2
samba-352d40c0664919530f394c83fbbb7eb53adb1f31.zip
netapi: add libnetapi_samr_free().
Guenther (This used to be commit 3228088a0954ac25584d06a681f4e0615dee425c)
-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);
+}