diff --git a/argvsplit.c b/argvsplit.c index 2c00236..3d6d2b6 100644 --- a/argvsplit.c +++ b/argvsplit.c @@ -24,6 +24,12 @@ #include "config.h" #include "pkg.h" +void argv_free(char **argv) +{ + free(argv[0]); + free(argv); +} + int argv_split(const char *src, int *argc, char ***argv) { char *buf = malloc(strlen(src) + 1); diff --git a/pkg.h b/pkg.h index 58b2e6f..4dc992e 100644 --- a/pkg.h +++ b/pkg.h @@ -151,6 +151,7 @@ void pkg_dependency_free(pkg_dependency_t *head); /* argvsplit.c */ int argv_split(const char *src, int *argc, char ***argv); +void argv_free(char **argv); /* fragment.c */ pkg_fragment_t *pkg_fragment_append(pkg_fragment_t *head, pkg_fragment_t *tail);