summaryrefslogtreecommitdiff
blob: 5a4eeb5cf2f6e1b1cdfec2f9667844bf2cd70fbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c
index 80b09fa..374a86a 100644
--- a/source/libsmb/libsmbclient.c
+++ b/source/libsmb/libsmbclient.c
@@ -2644,7 +2644,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;
                 }