summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2024-06-11 01:21:42 +0000
committerDamien Miller <djm@cvs.openbsd.org>2024-06-11 01:21:42 +0000
commit5653d05513c5d9b8f49871dbfce62cc486928dea (patch)
tree4d30deeac38669162b8fc02212c5c8b0f9460559
parentb2336d582e4c7043d0dfd111e7c9ae93812d6e1c (diff)
move tree init before possible early return
-rw-r--r--usr.bin/ssh/srclimit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/srclimit.c b/usr.bin/ssh/srclimit.c
index ffea6a3973e..011b83a4d3a 100644
--- a/usr.bin/ssh/srclimit.c
+++ b/usr.bin/ssh/srclimit.c
@@ -106,6 +106,8 @@ srclimit_init(int max, int persource, int ipv4len, int ipv6len,
penalty_cfg = *penalty_conf;
penalty_exempt = penalty_exempt_conf == NULL ?
NULL : xstrdup(penalty_exempt_conf);
+ RB_INIT(&penalties_by_addr);
+ RB_INIT(&penalties_by_expiry);
if (max_persource == INT_MAX) /* no limit */
return;
debug("%s: max connections %d, per source %d, masks %d,%d", __func__,
@@ -115,8 +117,6 @@ srclimit_init(int max, int persource, int ipv4len, int ipv6len,
children = xcalloc(max_children, sizeof(*children));
for (i = 0; i < max_children; i++)
children[i].id = -1;
- RB_INIT(&penalties_by_addr);
- RB_INIT(&penalties_by_expiry);
}
/* returns 1 if connection allowed, 0 if not allowed. */