fix memleaks
avoid memleak if memory is full
fix "memleak" at the end of mbus_parse_hex