Fixed some bugs (ie. possible of memory leaks) on Adhoc, and implement a few more Adhoc functions.
Merge pull request #6421 from ANR2ME/master

Fixed some bugs (ie. possible of memory leaks) on Adhoc, and implement a...