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:
12
pwutil.c
12
pwutil.c
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user