summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2013-12-19 00:27:58 +0000
committerDamien Miller <djm@cvs.openbsd.org>2013-12-19 00:27:58 +0000
commit2d3d4ca1cf04ba95202757ad5bbcc3998f81e896 (patch)
treee0493d2abf06e72720dc7820d5e36225fd45e9e1 /usr.bin
parent99d77a463e8cbdff03565d5dea9091e88fddfbe2 (diff)
simplify freeing of source-address certificate restriction
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/auth-options.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ssh/auth-options.c b/usr.bin/ssh/auth-options.c
index 15a7a6e49f1..fb62ef304a5 100644
--- a/usr.bin/ssh/auth-options.c
+++ b/usr.bin/ssh/auth-options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.c,v 1.61 2013/11/08 00:39:14 djm Exp $ */
+/* $OpenBSD: auth-options.c,v 1.62 2013/12/19 00:27:57 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -430,7 +430,7 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw,
u_char *data_blob = NULL;
u_int nlen, dlen, clen;
Buffer c, data;
- int ret = -1, found;
+ int ret = -1, result, found;
buffer_init(&data);
@@ -499,11 +499,12 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw,
goto out;
}
remote_ip = get_remote_ipaddr();
- switch (addr_match_cidr_list(remote_ip,
- allowed)) {
+ result = addr_match_cidr_list(remote_ip,
+ allowed);
+ free(allowed);
+ switch (result) {
case 1:
/* accepted */
- free(allowed);
break;
case 0:
/* no match */
@@ -516,12 +517,11 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw,
"is not permitted to use this "
"certificate for login.",
remote_ip);
- free(allowed);
goto out;
case -1:
+ default:
error("Certificate source-address "
"contents invalid");
- free(allowed);
goto out;
}
found = 1;