Univention Bugzilla – Bug 34747
re-check all realloc() error handling
Last modified: 2018-04-13 13:29:17 CEST
> RETURN VALUE
> The realloc() function returns ... NULL if the request fails. ...
> If realloc() fails the original block is left untouched; it is not freed or moved.
In the listener the return value is currently directly assigned to the "parent container". On allocation errors this would not only lose the previous content, but also proper handling is missing in most cases.
They should be check and be changed to something like
void *tmp = realloc(some_var, ...)
some_var = tmp;
perror("Out-of-memory in realloc()");
Also see Bug #30263
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.
If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.