ENH: fix memory leak
This commit is contained in:
parent
0d54001276
commit
3366e6c2cd
@ -84,6 +84,7 @@ RegularExpression& RegularExpression::operator= (const RegularExpression& rxp)
|
|||||||
}
|
}
|
||||||
int ind;
|
int ind;
|
||||||
this->progsize = rxp.progsize; // Copy regular expression size
|
this->progsize = rxp.progsize; // Copy regular expression size
|
||||||
|
delete [] this->program;
|
||||||
this->program = new char[this->progsize]; // Allocate storage
|
this->program = new char[this->progsize]; // Allocate storage
|
||||||
for(ind=this->progsize; ind-- != 0;) // Copy regular expresion
|
for(ind=this->progsize; ind-- != 0;) // Copy regular expresion
|
||||||
this->program[ind] = rxp.program[ind];
|
this->program[ind] = rxp.program[ind];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user