Merge "Check malloc result to avoid NPD" into lmp-dev