diff options
author | Günther Deschner <gd@samba.org> | 2008-04-16 02:16:08 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-04-22 08:51:52 +0200 |
commit | 3886e7431d8d6d573716d7dc9a7a79edc5dd3e3c (patch) | |
tree | 1371422828da8257d7ad517e4d833a1a64b40071 | |
parent | dd282075fa93e1b0f7280721bf0f38f486c864ec (diff) | |
download | samba-3886e7431d8d6d573716d7dc9a7a79edc5dd3e3c.tar.gz samba-3886e7431d8d6d573716d7dc9a7a79edc5dd3e3c.tar.xz samba-3886e7431d8d6d573716d7dc9a7a79edc5dd3e3c.zip |
net/libnetapi: Include netapi headers early and free on exit.
Guenther
(cherry picked from commit 020b1e6431601fadf44dbfe8393908c096ecfa4c)
-rw-r--r-- | source/utils/net.c | 7 | ||||
-rw-r--r-- | source/utils/net.h | 2 | ||||
-rw-r--r-- | source/utils/net_dom.c | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/source/utils/net.c b/source/utils/net.c index 5706e336de6..f6851f69da6 100644 --- a/source/utils/net.c +++ b/source/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/source/utils/net.h b/source/utils/net.h index 3a4b1da7b08..00a818a6063 100644 --- a/source/utils/net.h +++ b/source/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/source/utils/net_dom.c b/source/utils/net_dom.c index e88bbdb276e..6e4bf14c84d 100644 --- a/source/utils/net_dom.c +++ b/source/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; } |