[addagent] fix compiler warnings
[addagent] correct indent
[addagent] fix memory leak
[addagent] fix CID 28507
[addagent] fix CID 28428
[addagent] fix CID 28424
[addagent] fix CID 28425
[addagent] fix CID 28426
[addagent] fix CID 28503
[addagent] fix build
Merge pull request #372 from cgzones/addagent

addagent