summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-16 20:34:15 +0100
committerStefan Metzmacher <metze@samba.org>2009-12-16 20:34:15 +0100
commitfae70e1f54fb0bcc6c39caad70ed69a626640381 (patch)
tree975f5aef57c82aa157c581096b81086c4d55cccd
parentc457d54434ce0f475a53d3205d703b9370f7c264 (diff)
downloadsamba-fae70e1f54fb0bcc6c39caad70ed69a626640381.tar.gz
samba-fae70e1f54fb0bcc6c39caad70ed69a626640381.tar.bz2
samba-fae70e1f54fb0bcc6c39caad70ed69a626640381.zip
s4:gensec: allow clearing local and remote address by passing NULL
metze
-rw-r--r--source4/auth/gensec/gensec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index 8de7b4b7e6..ecd0778ee6 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -1184,6 +1184,11 @@ _PUBLIC_ NTSTATUS gensec_set_local_address(struct gensec_security *gensec_securi
const struct tsocket_address *local)
{
TALLOC_FREE(gensec_security->local_addr);
+
+ if (local == NULL) {
+ return NT_STATUS_OK;
+ }
+
gensec_security->local_addr = tsocket_address_copy(local, gensec_security);
if (gensec_security->local_addr == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -1206,6 +1211,11 @@ _PUBLIC_ NTSTATUS gensec_set_remote_address(struct gensec_security *gensec_secur
const struct tsocket_address *remote)
{
TALLOC_FREE(gensec_security->remote_addr);
+
+ if (remote == NULL) {
+ return NT_STATUS_OK;
+ }
+
gensec_security->remote_addr = tsocket_address_copy(remote, gensec_security);
if (gensec_security->remote_addr == NULL) {
return NT_STATUS_NO_MEMORY;