HPCC-10552 Fix various leaks and out of bound accesses

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Close a couple of sockets in error situations

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Fix a couple of leaks

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Need to call malloc (to match called by setBuffer)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Uninitialised variable and leak

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Break instead of return to ensure replytags,intertags deleted

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Missing va_end() calls and other minor issues

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 More cleaning up and removing dead code

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 A few more one-off errors reported by Coverity

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-10552 Correct typo from review

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #5230 from ghalliday/issue10552

HPCC-10552 First round of coverity related changes

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>