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:
parent
241adf4455
commit
a23f17d3b1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user