2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Add efree() for consistency with emalloc() et al. Allows us to rely

on C89 behavior (free(NULL) is valid) even on K&R.
This commit is contained in:
Todd C. Miller
2005-03-29 14:29:47 +00:00
parent 9efe91fa1e
commit 304dc46d7f
19 changed files with 107 additions and 125 deletions

View File

@@ -290,11 +290,11 @@ sudo_fakepwuid(uid)
/* Store by uid and by name, overwriting cached version. */
if ((node = rbinsert(pwcache_byuid, pw)) != NULL) {
free(node->data);
efree(node->data);
node->data = (VOID *) pw;
}
if ((node = rbinsert(pwcache_byname, pw)) != NULL) {
free(node->data);
efree(node->data);
node->data = (VOID *) pw;
}
return(pw);
@@ -320,11 +320,11 @@ sudo_fakepwnam(user)
/* Store by uid and by name, overwriting cached version. */
if ((node = rbinsert(pwcache_byuid, pw)) != NULL) {
free(node->data);
efree(node->data);
node->data = (VOID *) pw;
}
if ((node = rbinsert(pwcache_byname, pw)) != NULL) {
free(node->data);
efree(node->data);
node->data = (VOID *) pw;
}
return(pw);
@@ -362,9 +362,9 @@ pw_free(v)
if (pw->pw_passwd != NULL) {
zero_bytes(pw->pw_passwd, strlen(pw->pw_passwd));
free(pw->pw_passwd);
efree(pw->pw_passwd);
}
free(pw);
efree(pw);
}
/*