svn commit: r361753 - stable/12/usr.sbin/ctld
Mark Johnston
markj at FreeBSD.org
Wed Jun 3 14:54:55 UTC 2020
Author: markj
Date: Wed Jun 3 14:54:54 2020
New Revision: 361753
URL: https://svnweb.freebsd.org/changeset/base/361753
Log:
MFC r361654:
ctld: Fix a memory leak in uclparse_conf().
PR: 246596
Modified:
stable/12/usr.sbin/ctld/uclparse.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/usr.sbin/ctld/uclparse.c
==============================================================================
--- stable/12/usr.sbin/ctld/uclparse.c Wed Jun 3 14:16:40 2020 (r361752)
+++ stable/12/usr.sbin/ctld/uclparse.c Wed Jun 3 14:54:54 2020 (r361753)
@@ -914,6 +914,7 @@ int
uclparse_conf(struct conf *newconf, const char *path)
{
struct ucl_parser *parser;
+ ucl_object_t *top;
int error;
conf = newconf;
@@ -922,10 +923,14 @@ uclparse_conf(struct conf *newconf, const char *path)
if (!ucl_parser_add_file(parser, path)) {
log_warn("unable to parse configuration file %s: %s", path,
ucl_parser_get_error(parser));
+ ucl_parser_free(parser);
return (1);
}
- error = uclparse_toplevel(ucl_parser_get_object(parser));
+ top = ucl_parser_get_object(parser);
+ error = uclparse_toplevel(top);
+ ucl_object_unref(top);
+ ucl_parser_free(parser);
return (error);
}
More information about the svn-src-all
mailing list