Skip to content

Commit 8388516

Browse files
committed
Fix build: use php_globfree wrapper in ZipArchive::addGlob early returns
GH-21702 added two `globfree()` calls at the no-match and open_basedir reject paths, but called `globfree` directly instead of the `php_globfree` wrapper used at the success path below. On systems where `<glob.h>` isn't transitively included, the build breaks with `-Werror=implicit-function-declaration`. Match the existing wrapper usage at line 715.
1 parent 9b8a647 commit 8388516

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ext/zip/php_zip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,14 +676,14 @@ int php_zip_glob(zend_string *spattern, zend_long flags, zval *return_value) /*
676676

677677
/* now catch the FreeBSD style of "no matches" */
678678
if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
679-
globfree(&globbuf);
679+
php_globfree(&globbuf);
680680
return 0;
681681
}
682682

683683
/* we assume that any glob pattern will match files from one directory only
684684
so checking the dirname of the first match should be sufficient */
685685
if (ZIP_OPENBASEDIR_CHECKPATH(globbuf.gl_pathv[0])) {
686-
globfree(&globbuf);
686+
php_globfree(&globbuf);
687687
return -1;
688688
}
689689

0 commit comments

Comments
 (0)