Date: Wed, 25 May 2016 00:16:52 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300635 - head/usr.sbin/ypserv Message-ID: <201605250016.u4P0GqnV093249@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: truckman Date: Wed May 25 00:16:52 2016 New Revision: 300635 URL: https://svnweb.freebsd.org/changeset/base/300635 Log: Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak. Reported by: Coverity CID: 1007414 MFC after: 1 week Modified: head/usr.sbin/ypserv/yp_server.c Modified: head/usr.sbin/ypserv/yp_server.c ============================================================================== --- head/usr.sbin/ypserv/yp_server.c Wed May 25 00:13:01 2016 (r300634) +++ head/usr.sbin/ypserv/yp_server.c Wed May 25 00:16:52 2016 (r300635) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605250016.u4P0GqnV093249>