tests(ai_client): fix remaining ai_provider_unref() use-after-free in test_ai_parse_models_empty_json
Some checks failed
CI Code / Check spelling (pull_request) Successful in 16s
CI Code / Check coding style (pull_request) Successful in 28s
CI Code / Code Coverage (pull_request) Successful in 2m34s
CI Code / Linux (ubuntu) (pull_request) Has been cancelled
CI Code / Linux (debian) (pull_request) Has been cancelled
CI Code / Linux (arch) (pull_request) Has been cancelled

The test called ai_provider_unref(provider) on a provider owned by the
hash table, then ai_client_shutdown() destroyed the hash table and
called ai_provider_unref() again on the dangling pointer.

Fix by removing the redundant unref call.
This commit is contained in:
2026-05-15 01:50:26 +00:00
parent 360c5fb0a9
commit 91695c0d4d

View File

@@ -819,7 +819,6 @@ test_ai_parse_models_empty_json(void** state)
assert_null(provider->models);
assert_int_equal(0, g_list_length(provider->models));
ai_provider_unref(provider);
ai_client_shutdown();
}