Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak.

Reported by:	Coverity
CID:		1007414
MFC after:	1 week
This commit is contained in:
truckman 2016-05-25 00:16:52 +00:00
parent b6a7cc7788
commit 83a68a2048

View File

@ -711,6 +711,7 @@ yp_maplist_create(const char *domain)
yp_error("strdup() failed: %s",strerror(errno));
closedir(dird);
yp_maplist_free(yp_maplist);
free(cur);
return(NULL);
}
cur->next = yp_maplist;