chore: rule of 3 for strdup guard (#3905)

This commit is contained in:
Aaron Gokaslan 2022-04-26 15:49:24 -04:00 committed by GitHub
parent 9bc2704430
commit 75007dda72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,6 +312,10 @@ protected:
// along the way.
class strdup_guard {
public:
strdup_guard() = default;
strdup_guard(const strdup_guard &) = delete;
strdup_guard &operator=(const strdup_guard &) = delete;
~strdup_guard() {
for (auto *s : strings) {
std::free(s);