8244d5a
diff --git a/servconf.c b/servconf.c
8244d5a
index ad5869b..0255ed3 100644
8244d5a
--- a/servconf.c
8244d5a
+++ b/servconf.c
8244d5a
@@ -1910,6 +1910,8 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
8244d5a
 		dst->n = src->n; \
8244d5a
 } while (0)
8244d5a
 
8244d5a
+	u_int i;
8244d5a
+
8244d5a
 	M_CP_INTOPT(password_authentication);
8244d5a
 	M_CP_INTOPT(gss_authentication);
8244d5a
 	M_CP_INTOPT(rsa_authentication);
8244d5a
@@ -1947,8 +1949,10 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
8244d5a
 } while(0)
8244d5a
 #define M_CP_STRARRAYOPT(n, num_n) do {\
8244d5a
 	if (src->num_n != 0) { \
8244d5a
+		for (i = 0; i < dst->num_n; i++) \
8244d5a
+			free(dst->n[i]); \
8244d5a
 		for (dst->num_n = 0; dst->num_n < src->num_n; dst->num_n++) \
8244d5a
-			dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \
8244d5a
+			dst->n[dst->num_n] = src->n[dst->num_n]; \
8244d5a
 	} \
8244d5a
 } while(0)
8244d5a