argv_delete.c 534 B

1234567891011121314151617181920212223242526
  1. /*
  2. * argv_delete.c
  3. */
  4. #include "private.h"
  5. #include "lub/string.h"
  6. #include <stdlib.h>
  7. /*--------------------------------------------------------- */
  8. static void lub_argv_fini(lub_argv_t * this)
  9. {
  10. unsigned i;
  11. for (i = 0; i < this->argc; i++)
  12. lub_string_free(this->argv[i].arg);
  13. free(this->argv);
  14. this->argv = NULL;
  15. }
  16. /*--------------------------------------------------------- */
  17. void lub_argv_delete(lub_argv_t * this)
  18. {
  19. lub_argv_fini(this);
  20. free(this);
  21. }
  22. /*--------------------------------------------------------- */