Fix memory leak

PR:		bin/64321
Submitted by:	Rodney Ruddock <rodney@interopsystems.com>
MFOpenBSD:	rev 1.17
MFC after:	3 days
This commit is contained in:
Colin Percival 2004-03-16 08:33:33 +00:00
parent a961520c13
commit 3ed29c96cf

View File

@ -203,7 +203,7 @@ name_uid(uid_t uid, int frc)
++pwopn;
}
if (ptr == NULL)
ptr = (UIDC *)malloc(sizeof(UIDC));
ptr = uidtb[uid % UID_SZ] = (UIDC *)malloc(sizeof(UIDC));
if ((pw = getpwuid(uid)) == NULL) {
/*
@ -274,7 +274,7 @@ name_gid(gid_t gid, int frc)
++gropn;
}
if (ptr == NULL)
ptr = (GIDC *)malloc(sizeof(GIDC));
ptr = gidtb[gid % GID_SZ] = (GIDC *)malloc(sizeof(GIDC));
if ((gr = getgrgid(gid)) == NULL) {
/*