]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: do not leak oprincipals; ok djm
authormarkus@openbsd.org <markus@openbsd.org>
Fri, 6 Mar 2020 18:28:50 +0000 (18:28 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 13 Mar 2020 02:18:31 +0000 (13:18 +1100)
OpenBSD-Commit-ID: 4691d9387eab36f8fda48f5d8009756ed13a7c4c

sshsig.c

index 781153fce404bf33e1a0a1f399fa32845f838af6..15f9cead697f31363085e770b2b0132bb4f3e2cf 100644 (file)
--- 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)) {