mirror of
https://github.com/nasa/trick.git
synced 2025-01-22 04:18:09 +00:00
Input processor crashes if second event with same name is created
When allocating a new event, if the same name is used, no allocation is created and NULL is returned. We start trying to use the returned value which seg-faulted. I added a check to only continue if the returned value from the allocation is not NULL. refs #149
This commit is contained in:
parent
03d89ef56a
commit
014d78e388
@ -30,7 +30,9 @@ Trick::IPPythonEvent * ippython_new_event(std::string event_name) {
|
||||
// Allocate space for the event.
|
||||
oss << "Trick::IPPythonEvent " << event_name << "[1]" ;
|
||||
Trick::IPPythonEvent * event = (Trick::IPPythonEvent*) TMM_declare_var_s(oss.str().c_str());
|
||||
if (event != NULL) {
|
||||
event->set_name(event_name) ;
|
||||
}
|
||||
|
||||
return (event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user