From 0d07fa5da9f4c287410ce68d9d89da5c436fcc68 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 29 Jul 2020 17:09:53 +0200 Subject: clientlib: Fix behaviour for zero history --- ssh/tomsg_clientlib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ssh/tomsg_clientlib.c b/ssh/tomsg_clientlib.c index adcb4ee..e6d3684 100644 --- a/ssh/tomsg_clientlib.c +++ b/ssh/tomsg_clientlib.c @@ -815,6 +815,11 @@ static enum tomsg_retval handle_line( inflight.event.history.messages = calloc(count, sizeof(struct history_message)); if (!inflight.event.history.messages) CLEANUP_RETURN(TOMSG_ERR_MEMORY); + // If there are no history_message's coming, complete early + if (count == 0) { + SUCCESS_RETURN(); + } + // Re-add the tag for the history_message events enum tomsg_retval ret = add_inflight(client, tag, inflight.event); if (ret != TOMSG_OK) return ret; -- cgit v1.2.3-70-g09d2