Skip to content

Commit

Permalink
Fix potential leak in bssl::Array::Shrink.
Browse files Browse the repository at this point in the history
We don't currently use this type anywhere with a nontrivial destructor,
so this doesn't matter right now. But handle this correctly in case we
ever do. (One of these days, we should sort out using the STL and Abseil
in here...)

Change-Id: I6a198ccf87f953cedcdbe658fa508a3b79d47305
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/42825
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
  • Loading branch information
davidben authored and CQ bot account: commit-bot@chromium.org committed Sep 15, 2020
1 parent 6ad3b46 commit 662bfad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ssl/internal.h
Expand Up @@ -345,6 +345,9 @@ class Array {
if (new_size > size_) {
abort();
}
for (size_t i = new_size; i < size_; i++) {
data_[i].~T();
}
size_ = new_size;
}

Expand Down

0 comments on commit 662bfad

Please sign in to comment.