malloc can always fail. Check to avoid null dereference. malloc(0) is well defined but leads to an eventual crash on some systems. Check it too.
malloc can always fail. Check to avoid null dereference. malloc(0) is well defined but leads to an eventual crash on some systems. Check it too.