summaryrefslogtreecommitdiff
path: root/sshsig.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2020-03-06 18:28:50 +0000
committerDamien Miller <djm@mindrot.org>2020-03-13 13:18:31 +1100
commit5732d58020309364bf31fa125354e399361006db (patch)
treee1be58bbf8c41c2a88d71a0fff698a6780ec8ec6 /sshsig.c
parent8fae395f34c2c52cdaf9919aa261d1848b4bb00b (diff)
upstream: do not leak oprincipals; ok djm
OpenBSD-Commit-ID: 4691d9387eab36f8fda48f5d8009756ed13a7c4c
Diffstat (limited to 'sshsig.c')
-rw-r--r--sshsig.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sshsig.c b/sshsig.c
index 781153fce..15f9cead6 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -881,8 +881,10 @@ cert_filter_principals(const char *path, u_long linenum,
881 oprincipals = principals = *principalsp; 881 oprincipals = principals = *principalsp;
882 *principalsp = NULL; 882 *principalsp = NULL;
883 883
884 if ((nprincipals = sshbuf_new()) == NULL) 884 if ((nprincipals = sshbuf_new()) == NULL) {
885 return SSH_ERR_ALLOC_FAIL; 885 r = SSH_ERR_ALLOC_FAIL;
886 goto out;
887 }
886 888
887 while ((cp = strsep(&principals, ",")) != NULL && *cp != '\0') { 889 while ((cp = strsep(&principals, ",")) != NULL && *cp != '\0') {
888 if (strcspn(cp, "!?*") != strlen(cp)) { 890 if (strcspn(cp, "!?*") != strlen(cp)) {