mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-21 16:32:25 +01:00
The destructor always assumed that it would be called on objects created from
ONE constructor routine. This was bogus - there is also a system provided constructor which does not allocate a pattern buffer. Make less assumptions.
This commit is contained in:
parent
dbec390e8a
commit
47d5df1d7d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6373
@ -39,10 +39,13 @@ extern "C" {
|
||||
|
||||
Regex::~Regex()
|
||||
{
|
||||
if (buf->buffer) free(buf->buffer);
|
||||
if (buf->fastmap) free(buf->fastmap);
|
||||
delete(buf);
|
||||
delete(reg);
|
||||
if (buf) {
|
||||
if (buf->buffer) free(buf->buffer);
|
||||
if (buf->fastmap) free(buf->fastmap);
|
||||
delete(buf);
|
||||
}
|
||||
if (reg)
|
||||
delete(reg);
|
||||
}
|
||||
|
||||
Regex::Regex(const char* t, int fast, int bufsize,
|
||||
|
Loading…
Reference in New Issue
Block a user