mallocing wrong place for transaction segments