diff options
author | Patrick Griffis <pgriffis@igalia.com> | 2022-10-06 13:24:53 -0500 |
---|---|---|
committer | Patrick Griffis <pgriffis@igalia.com> | 2022-10-06 14:07:27 -0500 |
commit | 410e52a4e6ea31e760f114f2320b55419f116701 (patch) | |
tree | 377734ac818e66acc539ccc425a5dd6a73db1c81 | |
parent | a3741a472337dea80aa8b9e76436597b08dbe6a0 (diff) | |
download | libsoup-410e52a4e6ea31e760f114f2320b55419f116701.tar.gz |
Fix issues found by scan-build
-rw-r--r-- | tests/autobahn/autobahn-test.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/autobahn/autobahn-test.c b/tests/autobahn/autobahn-test.c index a6da3cd4..9c0b5094 100644 --- a/tests/autobahn/autobahn-test.c +++ b/tests/autobahn/autobahn-test.c @@ -268,22 +268,23 @@ int main (int argc, char *argv[]) int ret = 0; guint64 num_case = 1, num_cases; SoupSession *session; + const char *num_cases_env, *num_case_env, *timeout_env; test_init (argc, argv, NULL); if (!autobahn_server ("--start", &num_cases)) exit (1); - if (getenv ("AUTOBAHN_NUM_CASES")) - num_cases = atol (getenv ("AUTOBAHN_NUM_CASES")); + if ((num_cases_env = g_getenv ("AUTOBAHN_NUM_CASES"))) + num_cases = atol (num_cases_env); - if (getenv ("AUTOBAHN_NUM_CASE")) { - num_case = atol (getenv ("AUTOBAHN_NUM_CASE")); + if ((num_case_env = g_getenv ("AUTOBAHN_NUM_CASE"))) { + num_case = atol (num_case_env); num_cases = num_case; } - if (getenv ("AUTOBAHN_TEST_TIMEOUT")) - AUTOBAHN_TEST_TIMEOUT = atol (getenv ("AUTOBAHN_TEST_TIMEOUT")); + if ((timeout_env = g_getenv ("AUTOBAHN_TEST_TIMEOUT"))) + AUTOBAHN_TEST_TIMEOUT = atol (timeout_env); session = soup_session_new (); soup_session_add_feature_by_type (session, SOUP_TYPE_WEBSOCKET_EXTENSION_MANAGER); |