If a person makes a covenant with Allah the Exalted that he will do some act if a particular legitimate need is fulfilled, he must do the act once his need is fulfilled. If he makes a covenant to do something without mentioning any need, it becomes obligatory for him to do the act.