summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-18 00:02:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:23 -0500
commitee57c76a687c72ac7e8dc7c135ab53baa7a42776 (patch)
tree7374b0dd40265004c6dbf35131a8fa12bcb8364f /source4/client
parent82dfe0b29b4d090a20e0bc07a22ee47a5f38330a (diff)
downloadsamba-ee57c76a687c72ac7e8dc7c135ab53baa7a42776.tar.gz
samba-ee57c76a687c72ac7e8dc7c135ab53baa7a42776.tar.bz2
samba-ee57c76a687c72ac7e8dc7c135ab53baa7a42776.zip
r7704: - fixed open_nbt_connection() to return NULL when the connection failed
- got rid of smbcli_shutdown() and use talloc_free() instead. (This used to be commit 1011b1bf51d420d6702ef448c894ea8ebeafa284)
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/client.c10
-rw-r--r--source4/client/smbmount.c12
-rw-r--r--source4/client/smbspool.c2
3 files changed, 12 insertions, 12 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index a24fd7bfd3..5e5d7e5dcd 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -1069,7 +1069,7 @@ static BOOL do_altname(char *name)
****************************************************************************/
static int cmd_quit(const char **cmd_ptr)
{
- smbcli_shutdown(cli);
+ talloc_free(cli);
exit(0);
/* NOTREACHED */
return 0;
@@ -1263,7 +1263,7 @@ static int do_put(char *rname, char *lname, BOOL reput)
}
if (f == x_stdin) {
- smbcli_shutdown(cli);
+ talloc_free(cli);
exit(0);
}
@@ -3251,7 +3251,7 @@ static int process(char *base_directory)
process_stdin();
}
- smbcli_shutdown(cli);
+ talloc_free(cli);
return rc;
}
@@ -3287,12 +3287,12 @@ static int do_message_op(void)
if (!smbcli_transport_establish(cli, &calling, &called)) {
d_printf("session request failed\n");
- smbcli_shutdown(cli);
+ talloc_free(cli);
return 1;
}
send_message();
- smbcli_shutdown(cli);
+ talloc_free(cli);
return 0;
}
diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c
index 45c5f703ce..5c541a7e4f 100644
--- a/source4/client/smbmount.c
+++ b/source4/client/smbmount.c
@@ -151,7 +151,7 @@ static struct smbcli_state *do_connection(char *the_service)
!smbcli_connect(c, server_n, &ip)) {
DEBUG(0,("%d: Connection to %s failed\n", sys_getpid(), server_n));
if (c) {
- smbcli_shutdown(c);
+ talloc_free(c);
}
return NULL;
}
@@ -170,7 +170,7 @@ static struct smbcli_state *do_connection(char *the_service)
char *p;
DEBUG(0,("%d: session request to %s failed (%s)\n",
sys_getpid(), called.name, smbcli_errstr(c)));
- smbcli_shutdown(c);
+ talloc_free(c);
if ((p=strchr_m(called.name, '.'))) {
*p = 0;
goto again;
@@ -186,7 +186,7 @@ static struct smbcli_state *do_connection(char *the_service)
if (!smbcli_negprot(c)) {
DEBUG(0,("%d: protocol negotiation failed\n", sys_getpid()));
- smbcli_shutdown(c);
+ talloc_free(c);
return NULL;
}
@@ -220,7 +220,7 @@ static struct smbcli_state *do_connection(char *the_service)
!smbcli_session_setup(c, "", "", 0, "", 0, workgroup)) {
DEBUG(0,("%d: session setup failed: %s\n",
sys_getpid(), smbcli_errstr(c)));
- smbcli_shutdown(c);
+ talloc_free(c);
return NULL;
}
DEBUG(0,("Anonymous login successful\n"));
@@ -231,7 +231,7 @@ static struct smbcli_state *do_connection(char *the_service)
if (!smbcli_tconX(c, share, "?????", password, strlen(password)+1)) {
DEBUG(0,("%d: tree connect failed: %s\n",
sys_getpid(), smbcli_errstr(c)));
- smbcli_shutdown(c);
+ talloc_free(c);
return NULL;
}
@@ -379,7 +379,7 @@ static void send_fs_socket(char *the_service, char *mount_point, struct smbcli_s
If we don't do this we will "leak" sockets and memory on
each reconnection we have to make. */
- smbcli_shutdown(c);
+ talloc_free(c);
c = NULL;
if (!closed) {
diff --git a/source4/client/smbspool.c b/source4/client/smbspool.c
index 2e7afc5ec4..c975e04771 100644
--- a/source4/client/smbspool.c
+++ b/source4/client/smbspool.c
@@ -233,7 +233,7 @@ static int smb_print(struct smbcli_state *, char *, FILE *);
if ((status = smb_print(cli, argv[3] /* title */, fp)) != 0)
break;
- smbcli_shutdown(cli);
+ talloc_free(cli);
/*
* Return the queue status...