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:
cperciva 2004-03-16 08:33:33 +00:00
parent 3c4fad0869
commit 4d1e6cb1d3

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) {
/*