Lots of memory fixes.
Merge branch 'master' of https://github.com/CPqD/ofsoftswitch13