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:
Jani Nikula 2017-03-04 19:38:41 +02:00 committed by David Bremner
parent 6cb1c617a7
commit f3edc5dc86

View file

@ -38,7 +38,7 @@ compile_regex (regex_t &regexp, const char *str)
std::string msg;
(void) regerror (err, &regexp, buffer, len);
msg.assign (buffer, len);
delete buffer;
delete[] buffer;
throw Xapian::QueryParserError (msg);
}