diff options
author | Patrick Griffis <pgriffis@igalia.com> | 2020-11-13 14:34:35 -0600 |
---|---|---|
committer | Patrick Griffis <pgriffis@igalia.com> | 2020-11-13 14:56:30 -0600 |
commit | 48e6fc0065b84556900129636537401aea8dc4fe (patch) | |
tree | 47dc99d65fefcc4410b5ce5abe75a13ec94b4826 | |
parent | f599d4c81d35738a605df2c10487b51cba246e97 (diff) | |
download | libsoup-48e6fc0065b84556900129636537401aea8dc4fe.tar.gz |
Silence some scan-build warnings
-rw-r--r-- | libsoup/auth/soup-auth-negotiate.c | 2 | ||||
-rw-r--r-- | libsoup/soup-message-headers.c | 2 | ||||
-rw-r--r-- | tests/auth-test.c | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/libsoup/auth/soup-auth-negotiate.c b/libsoup/auth/soup-auth-negotiate.c index 46bd41bd..c022f1a9 100644 --- a/libsoup/auth/soup-auth-negotiate.c +++ b/libsoup/auth/soup-auth-negotiate.c @@ -202,6 +202,7 @@ soup_auth_negotiate_get_connection_authorization (SoupConnectionAuth *auth, } if (!soup_gss_build_response (conn, SOUP_AUTH (auth), &err)) { + g_assert (err); /* Silence scan-build */ /* FIXME: report further upward via * soup_message_get_error_message */ if (conn->initialized) @@ -276,6 +277,7 @@ soup_auth_negotiate_update_connection (SoupConnectionAuth *auth, SoupMessage *ms } goto out; } else { + g_assert (err); /* Silence scan-build */ /* FIXME: report further upward via * soup_message_get_error_message */ if (conn->initialized) diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c index b261460f..c84d7504 100644 --- a/libsoup/soup-message-headers.c +++ b/libsoup/soup-message-headers.c @@ -296,7 +296,9 @@ soup_message_headers_remove (SoupMessageHeaders *hdrs, const char *name) name = intern_header_name (name, &setter); while ((index = find_header (hdr_array, name, 0)) != -1) { +#ifndef __clang_analyzer__ /* False positive for double-free */ g_free (hdr_array[index].value); +#endif g_array_remove_index (hdrs->array, index); } if (hdrs->concat) diff --git a/tests/auth-test.c b/tests/auth-test.c index 94a521ec..3c89932c 100644 --- a/tests/auth-test.c +++ b/tests/auth-test.c @@ -812,10 +812,10 @@ select_auth_test_one (SoupURI *uri, sad.password = password; soup_test_session_send_message (session, msg); - soup_test_assert (strcmp (sad.round[0].headers, first_headers) == 0, + soup_test_assert (g_strcmp0 (sad.round[0].headers, first_headers) == 0, "Header order wrong: expected %s, got %s", first_headers, sad.round[0].headers); - soup_test_assert (strcmp (sad.round[0].response, first_response) == 0, + soup_test_assert (g_strcmp0 (sad.round[0].response, first_response) == 0, "Selected auth type wrong: expected %s, got %s", first_response, sad.round[0].response); @@ -824,10 +824,10 @@ select_auth_test_one (SoupURI *uri, soup_test_assert (!sad.round[1].headers || second_headers, "Didn't expect a second round"); if (second_headers && second_response) { - soup_test_assert (strcmp (sad.round[1].headers, second_headers) == 0, + soup_test_assert (g_strcmp0 (sad.round[1].headers, second_headers) == 0, "Second round header order wrong: expected %s, got %s\n", second_headers, sad.round[1].headers); - soup_test_assert (strcmp (sad.round[1].response, second_response) == 0, + soup_test_assert (g_strcmp0 (sad.round[1].response, second_response) == 0, "Second round selected auth type wrong: expected %s, got %s\n", second_response, sad.round[1].response); } |