From 83e7e2e733d4472bbd6a60d1f0d1702bf431dbc7 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 6 May 2012 21:09:40 -0500 Subject: [PATCH] argvsplit: add argv_free(). --- argvsplit.c | 6 ++++++ pkg.h | 1 + 2 files changed, 7 insertions(+) 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);