Skip to content

Commit 88f6706

Browse files
committed
fix leak
1 parent 14cd14d commit 88f6706

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

win32/readdir.c

+2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ DIR *opendir(const char *dir)
5454

5555
resolvedw = php_win32_ioutil_conv_any_to_w(resolved_path_buff, PHP_WIN32_CP_IGNORE_LEN, &resolvedw_len);
5656
if (!resolvedw) {
57+
free(dp);
5758
return NULL;
5859
}
5960

6061
filespecw_len = resolvedw_len + 2;
6162
filespecw = (wchar_t *)malloc((filespecw_len + 1)*sizeof(wchar_t));
6263
if (filespecw == NULL) {
64+
free(dp);
6365
free(resolvedw);
6466
return NULL;
6567
}

0 commit comments

Comments
 (0)