changeset 21369:2d7cb49b3c8d

lib-program-client: Fix crash after disconnecting client.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 09 Jan 2017 23:04:22 +0200
parents b26b043c4d82
children 6cda62d7de0e
files src/lib-program-client/program-client.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-program-client/program-client.c	Mon Jan 09 21:57:39 2017 +0200
+++ b/src/lib-program-client/program-client.c	Mon Jan 09 23:04:22 2017 +0200
@@ -330,9 +330,12 @@
 					i_stream_get_name(input),
 					i_stream_get_error(input));
 				program_client_fail(pclient, PROGRAM_CLIENT_ERROR_IO);
+				return;
 			} else {
-				if (!program_client_input_pending(pclient))
+				if (!program_client_input_pending(pclient)) {
 					program_client_disconnect(pclient, FALSE);
+					return;
+				}
 			}
 		}
 		if (program_client_input_pending(pclient))