This malloc() didn't have a check for successfully allocated memory. I created one following other examples.
LGTM
Please add same check here as well.
Done.
Victor, Shall I commit the changes on your behalf?
Yes, please.