diff --git a/sources/frontend.c b/sources/frontend.c index 40195c61f..3e5151eb9 100644 --- a/sources/frontend.c +++ b/sources/frontend.c @@ -996,7 +996,7 @@ static od_frontend_status_t od_frontend_remote_client(od_relay_t *relay, "%s", kiwi_fe_type_to_string(type)); od_frontend_status_t retstatus = OD_OK; - machine_msg_t *msg; + machine_msg_t *msg = NULL; bool forwarded = 0; switch (type) { case KIWI_FE_COPY_DONE: @@ -1513,7 +1513,7 @@ 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;