From: Todd C. Miller Date: Wed, 16 May 2018 16:45:00 +0000 (-0600) Subject: Fix memory leak on error, CID 185602 X-Git-Tag: SUDO_1_8_24^2~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ce49ecb2b30860cf2f5b4a4df6274f4486ab768;p=sudo Fix memory leak on error, CID 185602 --- diff --git a/plugins/sudoers/ldap_util.c b/plugins/sudoers/ldap_util.c index 4e47eccc8..21f5d8527 100644 --- a/plugins/sudoers/ldap_util.c +++ b/plugins/sudoers/ldap_util.c @@ -339,6 +339,7 @@ sudo_ldap_role_to_priv(const char *cn, void *hosts, void *runasusers, free(m); goto oom; } + m->name = (char *)c; } /* Negated commands have precedence so insert them at the end. */ @@ -492,7 +493,6 @@ sudo_ldap_role_to_priv(const char *cn, void *hosts, void *runasusers, char *args; m->type = COMMAND; - m->name = (char *)c; /* Fill in command with optional digest. */ if (sudo_ldap_extract_digest(&cmnd, &digest) != NULL) {