Fix memory leak in setProp