diff options
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/lib/match.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/match.c b/usr.sbin/pkg_install/lib/match.c index fd96f3f..cf745c3 100644 --- a/usr.sbin/pkg_install/lib/match.c +++ b/usr.sbin/pkg_install/lib/match.c @@ -297,11 +297,12 @@ storecreate(struct store *store) } store->currlen = 0; store->store = NULL; - } else - if (store->store != NULL) + } else if (store->store != NULL) { /* Free previously allocated memory */ for (i = 0; store->store[i] != NULL; i++) free(store->store[i]); + store->store[0] = NULL; + } store->used = 0; return store; |