
In the end of execute_sescmd_in_backend the buffer was consumed in case the protocol function failed. Or actually if it returned something else but 1. In the case of mysql_backend, the buffer is always freed when authorizing and either consumed or placed on the dcb writequeue when the data is written. That is, it is never ok to consume the buffer in this function. The end-result is likely to be an abort.