summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/raw/clisocket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 94bb447f47..1004db4040 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -173,9 +173,9 @@ BOOL smbcli_sock_connect_byname(struct smbcli_socket *sock, const char *host, in
if (ret) {
sock->hostname = talloc_steal(sock, name);
+ } else {
+ talloc_free(name);
}
- talloc_destroy(name);
-
return ret;
}