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;
                        }
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to