]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: test-program-client-net: Destroy test client upon error.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 25 Feb 2018 17:31:14 +0000 (18:31 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Jun 2019 09:22:30 +0000 (12:22 +0300)
This prevents infinite input event loop when something goes wrong.

src/lib-program-client/test-program-client-net.c

index 55b11fcbac663e82e92e3d66d6495edacb610fbb..0afb8d22b743c25201da81faec5f2115f9e48dd5 100644 (file)
@@ -214,8 +214,10 @@ static void test_program_input(struct test_client *client)
                }
        }
 
-       if (ret < 0 || client->in->stream_errno != 0)
+       if (ret < 0 || client->in->stream_errno != 0) {
+               test_program_client_destroy(&client);
                return;
+       }
        if (!client->in->eof)
                return;