Date: Tue, 20 Mar 2018 00:16:25 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331230 - head/contrib/blacklist/bin Message-ID: <201803200016.w2K0GPYH023915@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Tue Mar 20 00:16:24 2018 New Revision: 331230 URL: https://svnweb.freebsd.org/changeset/base/331230 Log: blacklist: Fix minor memory leak in configuration parsing error case Ordinarily, the continue clause of the for-loop would free 'line.' In this case we instead return early, missing the free. Add an explicit free to avoid the leak. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/contrib/blacklist/bin/conf.c Modified: head/contrib/blacklist/bin/conf.c ============================================================================== --- head/contrib/blacklist/bin/conf.c Tue Mar 20 00:03:49 2018 (r331229) +++ head/contrib/blacklist/bin/conf.c Tue Mar 20 00:16:24 2018 (r331230) @@ -1119,6 +1119,7 @@ conf_parse(const char *f) confset_free(&lc); confset_free(&rc); fclose(fp); + free(line); return; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803200016.w2K0GPYH023915>