diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-16 09:18:45 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-16 09:18:45 +0200 |
commit | b31c787401aaa2af361f059d3c9cac1b9e5af729 (patch) | |
tree | 29a897e7a0e2055b7943cad97019cf9db4cec0d1 /win32 | |
parent | ebb94af754ca3d365d400fda2190a7625c3c42fb (diff) | |
parent | 27bb0d91640b43224efca5a65134a9136d28fd53 (diff) | |
download | php-git-b31c787401aaa2af361f059d3c9cac1b9e5af729.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix readlink related memory leak
Diffstat (limited to 'win32')
-rw-r--r-- | win32/ioutil.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/win32/ioutil.h b/win32/ioutil.h index 8a522fe2f3..97fa6116fb 100644 --- a/win32/ioutil.h +++ b/win32/ioutil.h @@ -786,12 +786,14 @@ __forceinline static ssize_t php_win32_ioutil_readlink(const char *path, char *b ret_buf = php_win32_ioutil_conv_w_to_any(retw, ret, &ret_buf_len); if (!ret_buf || ret_buf_len >= buf_len || ret_buf_len >= MAXPATHLEN) { + free(ret_buf); free(pathw); SET_ERRNO_FROM_WIN32_CODE(ERROR_BAD_PATHNAME); return -1; } memcpy(buf, ret_buf, ret_buf_len + 1); + free(ret_buf); free(pathw); return ret_buf_len; |