mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix some leaks in php_scandir
Closes GH-18371.
This commit is contained in:
parent
bf4b470098
commit
81d9a27c47
2 changed files with 3 additions and 1 deletions
1
NEWS
1
NEWS
|
@ -5,6 +5,7 @@ PHP NEWS
|
||||||
- Core:
|
- Core:
|
||||||
. Fixed bug GH-18304 (Changing the properties of a DateInterval through
|
. Fixed bug GH-18304 (Changing the properties of a DateInterval through
|
||||||
dynamic properties triggers a SegFault). (nielsdos)
|
dynamic properties triggers a SegFault). (nielsdos)
|
||||||
|
. Fix some leaks in php_scandir. (nielsdos)
|
||||||
|
|
||||||
- Filter:
|
- Filter:
|
||||||
. Fixed bug GH-18309 (ipv6 filter integer overflow). (nielsdos)
|
. Fixed bug GH-18309 (ipv6 filter integer overflow). (nielsdos)
|
||||||
|
|
|
@ -83,7 +83,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se
|
||||||
|
|
||||||
newv = (struct dirent **) realloc (vector, vector_size * sizeof (struct dirent *));
|
newv = (struct dirent **) realloc (vector, vector_size * sizeof (struct dirent *));
|
||||||
if (!newv) {
|
if (!newv) {
|
||||||
return -1;
|
goto fail;
|
||||||
}
|
}
|
||||||
vector = newv;
|
vector = newv;
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,7 @@ fail:
|
||||||
free(vector[nfiles]);
|
free(vector[nfiles]);
|
||||||
}
|
}
|
||||||
free(vector);
|
free(vector);
|
||||||
|
closedir(dirp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue