diff --git a/sources/frontend.c b/sources/frontend.c index 40195c61f..1de3bbf93 100644 --- a/sources/frontend.c +++ b/sources/frontend.c @@ -997,6 +997,7 @@ static od_frontend_status_t od_frontend_remote_client(od_relay_t *relay, od_frontend_status_t retstatus = OD_OK; machine_msg_t *msg; + msg = NULL; bool forwarded = 0; switch (type) { case KIWI_FE_COPY_DONE: @@ -1513,7 +1514,8 @@ static od_frontend_status_t od_frontend_remote_client(od_relay_t *relay, } /* If the retstatus is not SKIP */ - if (route->rule->pool->reserve_prepared_statement && forwarded != 1) { + if (route->rule->pool->reserve_prepared_statement && forwarded != 1 && + msg != NULL) { msg = kiwi_fe_copy_msg(msg, data, size); od_write(&server->io, msg); retstatus = OD_SKIP;