Skip to content

Commit 6c55d7b

Browse files
committed
Refix use-after-free
1 parent 1c53e08 commit 6c55d7b

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

libpkg/pkg_config.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,6 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
12081208
ucl_object_replace_key(config, ucl_object_ref(cur), key, strlen(key), true);
12091209
}
12101210
}
1211-
ucl_object_unref(ncfg);
12121211
ncfg = NULL;
12131212
it = NULL;
12141213
while ((cur = ucl_iterate_object(config, &it, true))) {

tests/frontend/pkg.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ tests_init \
66
pkg_no_database \
77
pkg_config_defaults \
88
pkg_create_manifest_bad_syntax \
9-
pkg_repo_load_order
9+
pkg_repo_load_order \
10+
double_entry
1011

1112
pkg_no_database_body() {
1213
atf_skip_on Linux Test fails on Linux
@@ -87,3 +88,16 @@ pkg_repo_load_order_body()
8788
-s exit:0 \
8889
echo $out
8990
}
91+
92+
double_entry_body()
93+
{
94+
cat >> pkg.conf <<EOF
95+
pkg_env {}
96+
PKG_ENV : {
97+
http_proxy: "http://10.0.0.1:3128"
98+
https_proxy: "http://10.0.0.1:3128"
99+
ftp_proxy: "http://10.0.0.1:3128"
100+
}
101+
EOF
102+
atf_check -o ignore pkg -C ./pkg.conf -vv
103+
}

0 commit comments

Comments
 (0)