Fix resource leak detected by cppcheck
Test realloc failure to make cppcheck happy
goto considered harmful and confuses cppcheck.
Use reentrant version to silence warnings.
Remove useless assignment.
Use proper format string for unsigned data.
shorten scope of variables.
shorten scope of variable.
avoid strtok and reduce scope of variables.
check return of topoErr
Restrict size of inputs on sscanf reads.
Restrict size of read.
Remove use of usleep, which is sadly obsolete.