From 8ded1df76739363259edce0515b097510e342595 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 21 Dec 2007 15:12:40 +0100 Subject: Kill fstring in getdcname & getanydcname return. Guenther (This used to be commit b7383818168863a7ba43c2456f8c44e96e76707a) --- source3/rpc_client/cli_netlogon.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 3cb5827e73..26d2124da0 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -383,7 +383,7 @@ NTSTATUS rpccli_netlogon_logon_ctrl2(struct rpc_pipe_client *cli, TALLOC_CTX *me WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *mydcname, - const char *domainname, fstring newdcname) + const char *domainname, char **newdcname) { prs_struct qbuf, rbuf; NET_Q_GETANYDCNAME q; @@ -410,8 +410,9 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli, result = r.status; - if (W_ERROR_IS_OK(result)) { - rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname); + if (W_ERROR_IS_OK(result) && newdcname) { + *newdcname = rpcstr_pull_unistr2_talloc(mem_ctx, &r.uni_dcname); + W_ERROR_HAVE_NO_MEMORY(*newdcname); } return result; @@ -421,7 +422,7 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli, WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *mydcname, - const char *domainname, fstring newdcname) + const char *domainname, char **newdcname) { prs_struct qbuf, rbuf; NET_Q_GETDCNAME q; @@ -448,8 +449,9 @@ WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli, result = r.status; - if (W_ERROR_IS_OK(result)) { - rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname); + if (W_ERROR_IS_OK(result) && newdcname) { + *newdcname = rpcstr_pull_unistr2_talloc(mem_ctx, &r.uni_dcname); + W_ERROR_HAVE_NO_MEMORY(*newdcname); } return result; -- cgit