DESC Unlock ts->lock if malloc() fails inside jtrans_add(). EDESC If malloc() fails inside jtrans_add(), we leave ts->lock locked, which will cause a deadlock if we try to do almost any other operation with the transaction (in fact, freeing it will also make pthread_mutex_destroy() fail). This patch fixes it by unlocking before returning in those cases. Thanks to Shehjar Tikoo for the report.