summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-09-17 09:41:30 +0000
committerSimo Sorce <idra@samba.org>2001-09-17 09:41:30 +0000
commit941a3a5d3a46fd4fb913fddc6aa956361d218d23 (patch)
tree2154f3049a126a91cf5cc12a79909a2a00664fc8 /source3/rpc_client
parent091dbaa00bfb970137290a306ee77b4c5255b6c2 (diff)
downloadsamba-941a3a5d3a46fd4fb913fddc6aa956361d218d23.tar.gz
samba-941a3a5d3a46fd4fb913fddc6aa956361d218d23.tar.bz2
samba-941a3a5d3a46fd4fb913fddc6aa956361d218d23.zip
move to SAFE_FREE()
(This used to be commit 549fe42bd48b3418e63ba4872bc5992dae46d514)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_connect.c23
-rw-r--r--source3/rpc_client/cli_pipe.c11
-rw-r--r--source3/rpc_client/cli_trust.c3
-rw-r--r--source3/rpc_client/cli_use.c4
-rw-r--r--source3/rpc_client/ncacn_np_use.c4
5 files changed, 13 insertions, 32 deletions
diff --git a/source3/rpc_client/cli_connect.c b/source3/rpc_client/cli_connect.c
index ed01122383..f506729411 100644
--- a/source3/rpc_client/cli_connect.c
+++ b/source3/rpc_client/cli_connect.c
@@ -252,23 +252,10 @@ void cli_connection_free(struct cli_connection *con)
free(oldcli);
} */
- if (con->srv_name != NULL)
- {
- free(con->srv_name);
- con->srv_name = NULL;
- }
- if (con->pipe_name != NULL)
- {
- free(con->pipe_name);
- con->pipe_name = NULL;
- }
-
- if (con->auth_info != NULL)
- {
- free(con->auth_info);
- con->auth_info = NULL;
- }
-
+ SAFE_FREE(con->srv_name);
+ SAFE_FREE(con->pipe_name);
+ SAFE_FREE(con->auth_info);
+
memset(&con->usr_creds, 0, sizeof(con->usr_creds));
for (i = 0; i < num_cons; i++)
@@ -279,7 +266,7 @@ void cli_connection_free(struct cli_connection *con)
}
}
- free(con);
+ SAFE_FREE(con);
}
void cli_connection_unlink(struct cli_connection *con)
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 1496f05504..4415b461d9 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -363,10 +363,7 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, prs_struct *data, pr
/* Throw away returned params - we know we won't use them. */
- if(rparam) {
- free(rparam);
- rparam = NULL;
- }
+ SAFE_FREE(rparam);
if (prdata == NULL) {
DEBUG(0,("rpc_api_pipe: cmd %x on pipe %x failed to return data.\n",
@@ -934,10 +931,8 @@ static BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint1
state_set = True;
}
- if (rparam)
- free(rparam);
- if (rdata)
- free(rdata );
+ SAFE_FREE(rparam);
+ SAFE_FREE(rdata);
return state_set;
}
diff --git a/source3/rpc_client/cli_trust.c b/source3/rpc_client/cli_trust.c
index 440cc5143a..eed6ba7b2b 100644
--- a/source3/rpc_client/cli_trust.c
+++ b/source3/rpc_client/cli_trust.c
@@ -214,8 +214,7 @@ account password for domain %s.\n", domain));
break;
}
- if(ip_list != NULL)
- free((char *)ip_list);
+ SAFE_FREE(ip_list);
} else {
res = modify_trust_password( domain, remote_machine,
diff --git a/source3/rpc_client/cli_use.c b/source3/rpc_client/cli_use.c
index 5cd50ca5b0..fdd0ee9a5b 100644
--- a/source3/rpc_client/cli_use.c
+++ b/source3/rpc_client/cli_use.c
@@ -52,10 +52,10 @@ static void cli_use_free(struct cli_use *cli)
cli_ulogoff(cli->cli);
cli_shutdown(cli->cli);
}
- free(cli->cli);
+ SAFE_FREE(cli->cli);
}
- free(cli);
+ SAFE_FREE(cli);
}
/****************************************************************************
diff --git a/source3/rpc_client/ncacn_np_use.c b/source3/rpc_client/ncacn_np_use.c
index cb55feb655..99557d4a06 100644
--- a/source3/rpc_client/ncacn_np_use.c
+++ b/source3/rpc_client/ncacn_np_use.c
@@ -99,10 +99,10 @@ static void ncacn_np_use_free(struct ncacn_np_use *cli)
ncacn_np_shutdown(cli->cli);
}
ZERO_STRUCTP(cli->cli);
- free(cli->cli);
+ SAFE_FREE(cli->cli);
}
ZERO_STRUCTP(cli);
- free(cli);
+ SAFE_FREE(cli);
}
/****************************************************************************