GUACAMOLE-482: Fail overall encoding process if any instruction handler reports failure.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/guacamole-server/commit/19b5050f Tree: http://git-wip-us.apache.org/repos/asf/guacamole-server/tree/19b5050f Diff: http://git-wip-us.apache.org/repos/asf/guacamole-server/diff/19b5050f Branch: refs/heads/master Commit: 19b5050fbf6a61910ca145089042800211b93210 Parents: b0c14bd Author: Michael Jumper <[email protected]> Authored: Tue Feb 6 21:19:24 2018 -0800 Committer: Michael Jumper <[email protected]> Committed: Tue Feb 6 21:19:24 2018 -0800 ---------------------------------------------------------------------- src/guacenc/encode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/19b5050f/src/guacenc/encode.c ---------------------------------------------------------------------- diff --git a/src/guacenc/encode.c b/src/guacenc/encode.c index 854c5c6..2d74a9b 100644 --- a/src/guacenc/encode.c +++ b/src/guacenc/encode.c @@ -63,8 +63,11 @@ static int guacenc_read_instructions(guacenc_display* display, /* Continuously read and handle all instructions */ while (!guac_parser_read(parser, socket, -1)) { - guacenc_handle_instruction(display, parser->opcode, - parser->argc, parser->argv); + if (guacenc_handle_instruction(display, parser->opcode, + parser->argc, parser->argv)) { + guac_parser_free(parser); + return 1; + } } /* Fail on read/parse error */
