Add malloc check and error message "no such program"