[upstream] Add bc memory leak patch