Open
Description
The qt5cpp generator creates a method signature like this in SWGDefaultAPI:
void profileRoutePost(SWGProfile_route_body body, QString* token);
In C/CPP, this will cause 'body' to be copied. There is no proper copy constructor created for the models however, so pointers are re-used instead of new members being allocated.
When profileRoutePost returns, it will destroy the new copy of body and free the pointers. When the application eventually frees the original SWGProfile_route_body in the calling code, it will try to free the same pointers again, causing a segmentation fault due to a double free.
Performance wise, it's also really inefficient to be copying these objects unless that's really needed. Either passing by reference or pointer would fix the segfault and the unneeded copy.