[glib-networking] Fix early unref in test_client_auth_connection
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] Fix early unref in test_client_auth_connection
- Date: Mon, 16 Nov 2020 19:58:19 +0000 (UTC)
commit 532150b9d9ddd014a915598d6f4d232e1ccdea33
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Nov 16 13:50:27 2020 -0600
Fix early unref in test_client_auth_connection
Found by coverity
tls/tests/connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index eb18a58..fea6841 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -1050,7 +1050,6 @@ test_client_auth_connection (TestConnection *test,
cert = g_tls_certificate_new_from_file (tls_test_file_path ("client2-and-key.pem"), &error);
g_assert_no_error (error);
g_tls_connection_set_certificate (G_TLS_CONNECTION (test->client_connection), cert);
- g_object_unref (cert);
g_tls_connection_set_database (G_TLS_CONNECTION (test->client_connection), test->database);
read_test_data_async (test);
@@ -1064,6 +1063,7 @@ test_client_auth_connection (TestConnection *test,
peer = g_tls_connection_get_peer_certificate (G_TLS_CONNECTION (test->server_connection));
g_assert_nonnull (peer);
g_assert_true (g_tls_certificate_is_same (peer, cert));
+ g_object_unref (cert);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]