mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
in _freecaches(): strdup() allocates us memory -- remember to free it.
This commit is contained in:
parent
281cc46322
commit
243ae8c754
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8002
@ -461,22 +461,30 @@ struct _pw_cache *p, *m;
|
||||
struct _namelist *n;
|
||||
|
||||
while (_plushead) {
|
||||
while(_plushead->namelist) {
|
||||
n = _plushead->namelist->next;
|
||||
free(_plushead->namelist);
|
||||
_plushead->namelist = n;
|
||||
}
|
||||
while(_plushead->namelist) {
|
||||
n = _plushead->namelist->next;
|
||||
free(_plushead->namelist->name);
|
||||
free(_plushead->namelist);
|
||||
_plushead->namelist = n;
|
||||
}
|
||||
free(_plushead->pw_entry.pw_name);
|
||||
free(_plushead->pw_entry.pw_passwd);
|
||||
free(_plushead->pw_entry.pw_class);
|
||||
free(_plushead->pw_entry.pw_gecos);
|
||||
free(_plushead->pw_entry.pw_dir);
|
||||
free(_plushead->pw_entry.pw_shell);
|
||||
p = _plushead->next;
|
||||
free(_plushead);
|
||||
_plushead = p;
|
||||
}
|
||||
|
||||
while(_minushead) {
|
||||
while(_minushead->namelist) {
|
||||
n = _minushead->namelist->next;
|
||||
free(_minushead->namelist);
|
||||
_minushead->namelist = n;
|
||||
}
|
||||
while(_minushead->namelist) {
|
||||
n = _minushead->namelist->next;
|
||||
free(_minushead->namelist->name);
|
||||
free(_minushead->namelist);
|
||||
_minushead->namelist = n;
|
||||
}
|
||||
m = _minushead->next;
|
||||
free(_minushead);
|
||||
_minushead = m;
|
||||
|
Loading…
Reference in New Issue
Block a user