mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
lib: use delete[] to free buffer allocated using new[]
Fix warning caught by clang: lib/regexp-fields.cc:41:2: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete] delete buffer; ^ [] lib/regexp-fields.cc:37:17: note: allocated with 'new[]' here char *buffer = new char[len]; ^
This commit is contained in:
parent
6cb1c617a7
commit
f3edc5dc86
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ compile_regex (regex_t ®exp, const char *str)
|
||||||
std::string msg;
|
std::string msg;
|
||||||
(void) regerror (err, ®exp, buffer, len);
|
(void) regerror (err, ®exp, buffer, len);
|
||||||
msg.assign (buffer, len);
|
msg.assign (buffer, len);
|
||||||
delete buffer;
|
delete[] buffer;
|
||||||
|
|
||||||
throw Xapian::QueryParserError (msg);
|
throw Xapian::QueryParserError (msg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue