From: markus@openbsd.org Date: Fri, 6 Mar 2020 18:28:50 +0000 (+0000) Subject: upstream: do not leak oprincipals; ok djm X-Git-Tag: V_8_3_P1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5732d58020309364bf31fa125354e399361006db;p=thirdparty%2Fopenssh-portable.git upstream: do not leak oprincipals; ok djm OpenBSD-Commit-ID: 4691d9387eab36f8fda48f5d8009756ed13a7c4c --- 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, 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)) {