[communication] Corrects one call to sb_getAllocInBufLast()
[communication] Corrects segfault and other valgrind bugs.