Fixed malloc error in commit trans