6cf9b8e
diff -up openssh-7.4p1/servconf.c.memory openssh-7.4p1/servconf.c
6cf9b8e
--- openssh-7.4p1/servconf.c.memory	2016-12-23 15:37:48.181422360 +0100
6cf9b8e
+++ openssh-7.4p1/servconf.c	2016-12-23 15:38:30.189429116 +0100
6cf9b8e
@@ -2006,6 +2006,8 @@ copy_set_server_options(ServerOptions *d
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);
6cf9b8e
 	M_CP_INTOPT(pubkey_authentication);
6cf9b8e
@@ -2058,8 +2060,10 @@ copy_set_server_options(ServerOptions *d
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)
5b55d09
 #define M_CP_STRARRAYOPT_ALLOC(n, num_n) do { \