summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openbsd-compat/glob.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c
index d4e052fa0..7409b96e1 100644
--- a/openbsd-compat/glob.c
+++ b/openbsd-compat/glob.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: glob.c,v 1.43 2015/06/13 16:57:04 deraadt Exp $ */ 1/* $OpenBSD: glob.c,v 1.44 2015/09/14 16:09:13 tedu Exp $ */
2/* 2/*
3 * Copyright (c) 1989, 1993 3 * Copyright (c) 1989, 1993
4 * The Regents of the University of California. All rights reserved. 4 * The Regents of the University of California. All rights reserved.
@@ -968,15 +968,13 @@ globfree(glob_t *pglob)
968 if (pglob->gl_pathv != NULL) { 968 if (pglob->gl_pathv != NULL) {
969 pp = pglob->gl_pathv + pglob->gl_offs; 969 pp = pglob->gl_pathv + pglob->gl_offs;
970 for (i = pglob->gl_pathc; i--; ++pp) 970 for (i = pglob->gl_pathc; i--; ++pp)
971 if (*pp) 971 free(*pp);
972 free(*pp);
973 free(pglob->gl_pathv); 972 free(pglob->gl_pathv);
974 pglob->gl_pathv = NULL; 973 pglob->gl_pathv = NULL;
975 } 974 }
976 if (pglob->gl_statv != NULL) { 975 if (pglob->gl_statv != NULL) {
977 for (i = 0; i < pglob->gl_pathc; i++) { 976 for (i = 0; i < pglob->gl_pathc; i++) {
978 if (pglob->gl_statv[i] != NULL) 977 free(pglob->gl_statv[i]);
979 free(pglob->gl_statv[i]);
980 } 978 }
981 free(pglob->gl_statv); 979 free(pglob->gl_statv);
982 pglob->gl_statv = NULL; 980 pglob->gl_statv = NULL;