summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/libsmbclient.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 0b45cad3e1..ff434d275a 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -2671,7 +2671,11 @@ smbc_opendir_ctx(SMBCCTX *context,
return NULL;
}
- ip_list = &server_addr;
+ ip_list = memdup(&server_addr, sizeof(server_addr));
+ if (ip_list == NULL) {
+ errno = ENOMEM;
+ return NULL;
+ }
count = 1;
}