Use safer sizeof variant in malloc