From: Todd C. Miller Date: Thu, 18 Oct 2018 20:19:09 +0000 (-0600) Subject: If sudo_ldap_get_values_len() fails goto cleanup instead of oom. X-Git-Tag: SUDO_1_8_26^2~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54784a234ca63e91698e3bc4aac6d7177c663e92;p=sudo If sudo_ldap_get_values_len() fails goto cleanup instead of oom. This is not strictly necessary as there's not anything to cleanup in this case but it is more consistent with the code that follows. --- diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c index 60931a592..e1f858268 100644 --- a/plugins/sudoers/ldap.c +++ b/plugins/sudoers/ldap.c @@ -1151,13 +1151,13 @@ ldap_to_sudoers(LDAP *ld, struct ldap_result *lres, struct berval **runasusers = NULL, **runasgroups = NULL; struct berval **opts = NULL, **notbefore = NULL, **notafter = NULL; struct privilege *priv = NULL; - char *cn; + char *cn = NULL; /* Ignore sudoRole without sudoCommand. */ cmnds = sudo_ldap_get_values_len(ld, entry, "sudoCommand", &rc); if (cmnds == NULL) { if (rc == LDAP_NO_MEMORY) - goto oom; + goto cleanup; continue; }