]> 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@dovecot.fi>
Sun, 18 Mar 2018 10:53:18 +0000 (12:53 +0200)
This prevents infinite input event loop when something goes wrong.

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

index b337279360543fae0c6838c75ac3fdfb6a31983f..c7a6abcdf3ada80ad58f806ded1c8f74d926a970 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;