diff options
author | truckman <truckman@FreeBSD.org> | 2016-06-01 17:18:35 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2016-06-01 17:18:35 +0000 |
commit | 3b8f7769ef53354f14c7d2f559208e48bc5fa6fd (patch) | |
tree | 9580961623eaeef13e7c4a4045daca7ba689e880 | |
parent | a88b1b7c540b7773b6b257d5eefa8df2df43ac4e (diff) | |
download | FreeBSD-src-3b8f7769ef53354f14c7d2f559208e48bc5fa6fd.zip FreeBSD-src-3b8f7769ef53354f14c7d2f559208e48bc5fa6fd.tar.gz |
MFC r300635
Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak.
Reported by: Coverity
CID: 1007414
-rw-r--r-- | usr.sbin/ypserv/yp_server.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/ypserv/yp_server.c b/usr.sbin/ypserv/yp_server.c index ba20c3cd..304fd50 100644 --- a/usr.sbin/ypserv/yp_server.c +++ b/usr.sbin/ypserv/yp_server.c @@ -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; |