Skip to content
Snippets Groups Projects
Commit ef9b4d62 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

RegExp: Avoid possible segfault

parent 29c38fb8
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ void FormalRegExpConcatenation::setRightElement(const FormalRegExpElement& eleme
FormalRegExpElement* elem = element.clone();
if(this->parentRegExp && !elem->attachRegExp(this->parentRegExp))
throw exception::AlibException("Input symbols not in the alphabet.");
delete left;
delete right;
this->right = elem;
}
 
......@@ -101,7 +101,7 @@ void FormalRegExpConcatenation::setRightElement(FormalRegExpElement&& element) {
FormalRegExpElement* elem = std::move(element).plunder();
if(this->parentRegExp && !elem->attachRegExp(this->parentRegExp))
throw exception::AlibException("Input symbols not in the alphabet.");
delete left;
delete right;
this->right = elem;
}
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment