[upstream] bc memory leak patch