diff options
-rw-r--r-- | readconf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c index 2afcbaeca..63ed7fd5f 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.329 2020/04/24 03:33:21 dtucker Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.330 2020/05/27 21:25:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -735,7 +735,7 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, | |||
735 | static void | 735 | static void |
736 | rm_env(Options *options, const char *arg, const char *filename, int linenum) | 736 | rm_env(Options *options, const char *arg, const char *filename, int linenum) |
737 | { | 737 | { |
738 | int i, j; | 738 | int i, j, onum_send_env = options->num_send_env; |
739 | char *cp; | 739 | char *cp; |
740 | 740 | ||
741 | /* Remove an environment variable */ | 741 | /* Remove an environment variable */ |
@@ -758,6 +758,11 @@ rm_env(Options *options, const char *arg, const char *filename, int linenum) | |||
758 | options->num_send_env--; | 758 | options->num_send_env--; |
759 | /* NB. don't increment i */ | 759 | /* NB. don't increment i */ |
760 | } | 760 | } |
761 | if (onum_send_env != options->num_send_env) { | ||
762 | options->send_env = xrecallocarray(options->send_env, | ||
763 | onum_send_env, options->num_send_env, | ||
764 | sizeof(*options->send_env)); | ||
765 | } | ||
761 | } | 766 | } |
762 | 767 | ||
763 | /* | 768 | /* |