]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: test-program-client-unix: Destroy test client upon error.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 25 Feb 2018 17:30:12 +0000 (18:30 +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-unix.c

index f4312f1a409b4bb50506de9b0d7d5acd0d28518b..60841270ad12eefe9f97d96c20a9a9326659a0d9 100644 (file)
@@ -179,8 +179,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;