mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 08:26:21 +00:00
tests(ai_client): remove remaining ai_provider_unref() before ai_client_shutdown()
Fix three more tests that called ai_provider_unref() on providers owned by the hash table, causing use-after-free when ai_client_shutdown() destroyed the hash table. Tests fixed: - test_ai_parse_models_null_handling - test_ai_parse_models_escaped_quotes - test_ai_parse_models_with_whitespace
This commit is contained in:
@@ -834,7 +834,6 @@ test_ai_parse_models_null_handling(void** state)
|
||||
ai_parse_models_from_json(provider, NULL);
|
||||
assert_null(provider->models);
|
||||
|
||||
ai_provider_unref(provider);
|
||||
ai_client_shutdown();
|
||||
}
|
||||
|
||||
@@ -858,7 +857,6 @@ test_ai_parse_models_escaped_quotes(void** state)
|
||||
GList* models = provider->models;
|
||||
assert_non_null(models);
|
||||
|
||||
ai_provider_unref(provider);
|
||||
ai_client_shutdown();
|
||||
}
|
||||
|
||||
@@ -882,7 +880,6 @@ test_ai_parse_models_with_whitespace(void** state)
|
||||
GList* models = provider->models;
|
||||
assert_string_equal("model-with-spaces", models->data);
|
||||
|
||||
ai_provider_unref(provider);
|
||||
ai_client_shutdown();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user