Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Replace all ucl_object_free by ucl_object_unref
Baptiste Daroussin committed 12 years ago
commit b63dfc652f41934f9737c927248a06a1e386772a
parent 2f83a04
4 files changed +12 -12
modified libpkg/pkg_config.c
@@ -417,7 +417,7 @@ add_repo(ucl_object_t *obj, struct pkg_repo *r, const char *rname)
				    "'%s' key of the '%s' repo",
				    key, rname);
				if (tmp != NULL)
-
					ucl_object_free(tmp);
+
					ucl_object_unref(tmp);
				return;
			}
			if (tmp != NULL)
@@ -425,7 +425,7 @@ add_repo(ucl_object_t *obj, struct pkg_repo *r, const char *rname)
				    " the value has been correctly converted, please consider fixing", key, rname);
			enable = ucl_object_toboolean(tmp != NULL ? tmp : cur);
			if (tmp != NULL)
-
				ucl_object_free(tmp);
+
				ucl_object_unref(tmp);
		} else if (strcasecmp(key, "mirror_type") == 0) {
			if (cur->type != UCL_STRING) {
				pkg_emit_error("Expecting a string for the "
@@ -561,7 +561,7 @@ load_repo_file(const char *repofile)
	if (obj->type == UCL_OBJECT)
		walk_repo_obj(obj, repofile);

-
	ucl_object_free(obj);
+
	ucl_object_unref(obj);
}

static void
@@ -787,7 +787,7 @@ pkg_init(const char *path, const char *reposdir)
				pkg_emit_error("Invalid type for environment "
				    "variable %s, got %s, while expecting an integer",
				    key, val);
-
				ucl_object_free(o);
+
				ucl_object_unref(o);
				continue;
			}
			break;
@@ -797,7 +797,7 @@ pkg_init(const char *path, const char *reposdir)
				pkg_emit_error("Invalid type for environment "
				    "variable %s, got %s, while expecting a boolean",
				    key, val);
-
				ucl_object_free(o);
+
				ucl_object_unref(o);
				continue;
			}
			break;
modified libpkg/pkg_manifest.c
@@ -713,7 +713,7 @@ pkg_parse_manifest(struct pkg *pkg, char *buf, size_t len, struct pkg_manifest_k
		ucl_parser_free(p);
		p = NULL;
		if (obj != NULL)
-
			ucl_object_free(obj);
+
			ucl_object_unref(obj);
		obj = yaml_to_ucl(NULL, buf, len);
		if (obj == NULL)
			return (EPKG_FATAL);
@@ -721,7 +721,7 @@ pkg_parse_manifest(struct pkg *pkg, char *buf, size_t len, struct pkg_manifest_k

	rc = parse_manifest(pkg, keys, obj);

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

@@ -782,7 +782,7 @@ pkg_parse_manifest_file(struct pkg *pkg, const char *file, struct pkg_manifest_k
		ucl_parser_free(p);
		p = NULL;
		if (obj != NULL)
-
			ucl_object_free(obj);
+
			ucl_object_unref(obj);
		obj = yaml_to_ucl(file, NULL, 0);
		if (obj == NULL)
			return (EPKG_FATAL);
@@ -792,7 +792,7 @@ pkg_parse_manifest_file(struct pkg *pkg, const char *file, struct pkg_manifest_k

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

	return (rc);
}
@@ -823,7 +823,7 @@ pkg_emit_filelist(struct pkg *pkg, FILE *f)
	if (b != NULL)
		sbuf_delete(b);

-
	ucl_object_free(obj);
+
	ucl_object_unref(obj);

	return (EPKG_OK);
}
modified libpkg/pkg_repo.c
@@ -614,7 +614,7 @@ pkg_repo_load_fingerprint(const char *dir, const char *filename)
	if (obj->type == UCL_OBJECT)
		f = pkg_repo_parse_fingerprint(obj);

-
	ucl_object_free(obj);
+
	ucl_object_unref(obj);
	ucl_parser_free(p);

	return (f);
modified libpkg/plugins.c
@@ -359,7 +359,7 @@ pkg_plugin_parse(struct pkg_plugin *p)
	}

	p->parsed = true;
-
	ucl_object_free(obj);
+
	ucl_object_unref(obj);
	ucl_parser_free(pr);

	return (EPKG_OK);