2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-03 15:55:40 +00:00

belt and suspenders; zero out result after freeing it

This commit is contained in:
Todd C. Miller
2007-12-31 21:10:49 +00:00
parent 926dcd0bcc
commit b289130680

12
ldap.c
View File

@@ -860,8 +860,10 @@ sudo_ldap_display_privs(nss, pw)
ldap_value_free(v); ldap_value_free(v);
} }
} }
if (result) if (result) {
ldap_msgfree(result); ldap_msgfree(result);
result = NULL;
}
/* /*
* Okay - time to search for anything that matches this user * Okay - time to search for anything that matches this user
@@ -959,6 +961,7 @@ sudo_ldap_display_privs(nss, pw)
} }
} }
ldap_msgfree(result); ldap_msgfree(result);
result = NULL;
} }
} }
@@ -1009,8 +1012,7 @@ sudo_ldap_display_cmnd(nss, pw)
break; break;
} }
} }
if (result) ldap_msgfree(result);
ldap_msgfree(result);
result = NULL; result = NULL;
} }
@@ -1343,6 +1345,7 @@ sudo_ldap_lookup(nss, pwflag)
} }
} }
ldap_msgfree(result); ldap_msgfree(result);
result = NULL;
} }
if (ret || user_uid == 0) { if (ret || user_uid == 0) {
ret = VALIDATE_OK; ret = VALIDATE_OK;
@@ -1429,6 +1432,7 @@ sudo_ldap_lookup(nss, pwflag)
} }
} }
ldap_msgfree(result); ldap_msgfree(result);
result = NULL;
} }
} }
@@ -1446,7 +1450,7 @@ done:
else if (!ldap_host_matches) else if (!ldap_host_matches)
SET(ret, FLAG_NO_HOST); SET(ret, FLAG_NO_HOST);
} }
DPRINTF(("sudo_ldap_check(%d)=0x%02x", pwflag, ret), 1); DPRINTF(("sudo_ldap_lookup(%d)=0x%02x", pwflag, ret), 1);
return(ret); return(ret);
} }