Fix a memory leak in getent() that occurred when the requested entry

could not be found.

PR:		bin/17084
This commit is contained in:
Tim Vanderhoek 2000-05-21 02:55:09 +00:00
parent 3f81737f30
commit 8187dd1c8b
1 changed files with 3 additions and 1 deletions

View File

@ -382,8 +382,10 @@ getent(cap, len, db_array, fd, name, depth, nfield)
break;
}
if (!foundit)
if (!foundit) {
free(record);
return (-1);
}
/*
* Got the capability record, but now we have to expand all tc=name