summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-16 02:16:08 +0200
committerGünther Deschner <gd@samba.org>2008-04-16 02:16:08 +0200
commit0a362a94c8f720ad0805c0789433d3e70b86d1c3 (patch)
treef80e9421b272398450fe850430c71863ecdf2211 /source3/utils
parent46e6bc1153dbcf406f873a3e082582a44cd4467e (diff)
downloadsamba-0a362a94c8f720ad0805c0789433d3e70b86d1c3.tar.gz
samba-0a362a94c8f720ad0805c0789433d3e70b86d1c3.tar.bz2
samba-0a362a94c8f720ad0805c0789433d3e70b86d1c3.zip
net/libnetapi: Include netapi headers early and free on exit.
Guenther (This used to be commit 020b1e6431601fadf44dbfe8393908c096ecfa4c)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net.c7
-rw-r--r--source3/utils/net.h2
-rw-r--r--source3/utils/net_dom.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 5706e336de..f6851f69da 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -1169,6 +1169,13 @@ static struct functable net_func[] = {
rc = net_run_function(argc_new-1, argv_new+1, net_func, net_help);
DEBUG(2,("return code = %d\n", rc));
+
+ {
+ struct libnetapi_ctx *ctx = NULL;
+ libnetapi_getctx(&ctx);
+ libnetapi_free(ctx);
+ }
+
TALLOC_FREE(frame);
return rc;
}
diff --git a/source3/utils/net.h b/source3/utils/net.h
index 3a4b1da7b0..00a818a606 100644
--- a/source3/utils/net.h
+++ b/source3/utils/net.h
@@ -22,6 +22,8 @@
* include
*/
+#include "lib/netapi/netapi.h"
+
typedef NTSTATUS (*rpc_command_fn)(const DOM_SID *,
const char *,
struct cli_state *cli,
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c
index e88bbdb276..6e4bf14c84 100644
--- a/source3/utils/net_dom.c
+++ b/source3/utils/net_dom.c
@@ -19,7 +19,6 @@
#include "includes.h"
#include "utils/net.h"
-#include "lib/netapi/netapi.h"
static int net_dom_usage(int argc, const char **argv)
{
@@ -130,7 +129,6 @@ static int net_dom_unjoin(int argc, const char **argv)
cli_shutdown(cli);
}
- /* libnetapi_free(ctx); */
return ret;
}
@@ -244,7 +242,6 @@ static int net_dom_join(int argc, const char **argv)
cli_shutdown(cli);
}
- /* libnetapi_free(ctx); */
return ret;
}