diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2020-03-06 18:28:51 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2020-03-06 18:28:51 +0000 |
commit | 3d7652000ba41c1e100d8d79cc70ca0eebda2046 (patch) | |
tree | 55a4854c1c124ed08bd31895ae916d5d9176e8b5 /usr.bin/ssh | |
parent | 2a6081d14f011b8e2c791a063311a213782124be (diff) |
do not leak oprincipals; ok djm
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/sshsig.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshsig.c b/usr.bin/ssh/sshsig.c index d4ef9f573bf..8e6b19f3e2a 100644 --- a/usr.bin/ssh/sshsig.c +++ b/usr.bin/ssh/sshsig.c @@ -879,8 +879,10 @@ cert_filter_principals(const char *path, u_long linenum, oprincipals = principals = *principalsp; *principalsp = NULL; - if ((nprincipals = sshbuf_new()) == NULL) - return SSH_ERR_ALLOC_FAIL; + if ((nprincipals = sshbuf_new()) == NULL) { + r = SSH_ERR_ALLOC_FAIL; + goto out; + } while ((cp = strsep(&principals, ",")) != NULL && *cp != '\0') { if (strcspn(cp, "!?*") != strlen(cp)) { |