mmsh: fix potential memleak