number_set_new: Avoid memory leak in case of invalid input.