Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Only cleanout parser when needed
Baptiste Daroussin committed 12 years ago
commit 0cbd0ca143b9a8705d3207cbb64c8a9789ee9d18
parent 7f3a5a6
1 file changed +3 -1
modified libpkg/pkg_manifest.c
@@ -693,6 +693,7 @@ pkg_parse_manifest_file(struct pkg *pkg, const char *file, struct pkg_manifest_k
	if (fallback) {
		pkg_debug(2, "Falling back on yaml");
		ucl_parser_free(p);
+
		p = NULL;
		if (obj != NULL)
			ucl_obj_free(obj);
		obj = yaml_to_ucl(file, NULL, 0);
@@ -702,7 +703,8 @@ pkg_parse_manifest_file(struct pkg *pkg, const char *file, struct pkg_manifest_k

	rc = parse_manifest(pkg, keys, obj);

-
	ucl_parser_free(p);
+
	if (p != NULL)
+
		ucl_parser_free(p);
	ucl_obj_free(obj);

	return (rc);