Merge pull request #4047 from apple/anoyes/fix-heap-use-after-free

Fix heap use after free
This commit is contained in:
Meng Xu 2020-11-11 09:05:38 -08:00 committed by GitHub
commit 7ad036b459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -621,8 +621,10 @@ ACTOR Future<Void> shardTracker(
wait( delay(0, TaskPriority::DataDistribution) );
}
} catch (Error& e) {
if (e.code() != error_code_actor_cancelled)
self->output.sendError(e); // Propagate failure to dataDistributionTracker
// If e is broken_promise then self may have already been deleted
if (e.code() != error_code_actor_cancelled && e.code() != error_code_broken_promise) {
self->output.sendError(e); // Propagate failure to dataDistributionTracker
}
throw e;
}
}