[libsoup/gnome-3-28] Revert "test-utils: Fix uninitialized value issue found by Coverity Scan and clang"



commit aec0f11044ef1c15aa3f5cb74a9ba1cacadac88c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Jun 25 09:25:35 2018 -0500

    Revert "test-utils: Fix uninitialized value issue found by Coverity Scan and clang"
    
    This reverts commit 4cf3395dce21f577a979a57c74ab95d746273032.
    
    There is no uninitialized value issue here.

 tests/test-utils.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/tests/test-utils.c b/tests/test-utils.c
index 7a21fa02..9c742060 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -676,11 +676,9 @@ soup_test_request_read_all (SoupRequest   *req,
 
        if (!SOUP_IS_SESSION_SYNC (soup_request_get_session (req)))
                data.loop = g_main_loop_new (g_main_context_get_thread_default (), FALSE);
-       else
-               data.loop = NULL;
 
        do {
-               if (!data.loop) {
+               if (SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) {
                        nread = g_input_stream_read (stream, buf, sizeof (buf),
                                                     cancellable, error);
                } else {
@@ -693,7 +691,7 @@ soup_test_request_read_all (SoupRequest   *req,
                }
        } while (nread > 0);
 
-       if (data.loop)
+       if (!SOUP_IS_SESSION_SYNC (soup_request_get_session (req)))
                g_main_loop_unref (data.loop);
 
        return nread == 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]