svn commit: r296808 - head/usr.sbin/ctld

Jakub Wojciech Klama jceel at FreeBSD.org
Sun Mar 13 19:50:19 UTC 2016


Author: jceel
Date: Sun Mar 13 19:50:17 2016
New Revision: 296808
URL: https://svnweb.freebsd.org/changeset/base/296808

Log:
  Check value returned from ucl_parser_add_file().
  
  Reviewed by:	trasz
  Approved by:	trasz (mentor)
  MFC after:	1 month
  Sponsored by:	iXsystems, Inc.

Modified:
  head/usr.sbin/ctld/uclparse.c

Modified: head/usr.sbin/ctld/uclparse.c
==============================================================================
--- head/usr.sbin/ctld/uclparse.c	Sun Mar 13 19:42:59 2016	(r296807)
+++ head/usr.sbin/ctld/uclparse.c	Sun Mar 13 19:50:17 2016	(r296808)
@@ -886,9 +886,8 @@ uclparse_conf(struct conf *newconf, cons
 
 	conf = newconf;
 	parser = ucl_parser_new(0);
-	ucl_parser_add_file(parser, path);
 
-	if (ucl_parser_get_error(parser)) {
+	if (!ucl_parser_add_file(parser, path)) {
 		log_warn("unable to parse configuration file %s: %s", path,
 		    ucl_parser_get_error(parser));
 		return (1);


More information about the svn-src-all mailing list