diff options
author | ivan <ivan@13f79535-47bb-0310-9956-ffa450edef68> | 2022-09-12 16:29:33 +0000 |
---|---|---|
committer | ivan <ivan@13f79535-47bb-0310-9956-ffa450edef68> | 2022-09-12 16:29:33 +0000 |
commit | 88357a2af9c26df2baeb49b57d6262311c73a74b (patch) | |
tree | 441472f06e013361a0ac174b918884805541a5ff | |
parent | e2b078cb7ea55346cb2d2693924f7622bf154b46 (diff) | |
download | libapr-88357a2af9c26df2baeb49b57d6262311c73a74b.tar.gz |
On 1.7.x branch: Merge r1902111 from 1.8.x branch:
win32: Fix double free on exit when apr_app is used on Windows.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1904025 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | misc/win32/apr_app.c | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -73,6 +73,8 @@ Changes for APR 1.7.1 *) Fix attempt to free invalid memory on exit when apr_app is used on Windows. [Ivan Zhakov] + *) Fix double free on exit when apr_app is used on Windows. [Ivan Zhakov] + Changes for APR 1.7.0 *) apr_dir_read: [Unix] Dropped the preference of the dirread_r() flavor diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index f1b6ce57c..4b1874f33 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -91,9 +91,11 @@ int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv) * Reset _wenviron for good measure. */ if (_wenviron) { - wenv = _wenviron; _wenviron = NULL; - free((wchar_t **)wenv); + + /* There is no need to free _wenviron because MSVCRT + * automatically free 'initial' environment block. + */ } apr_app_init_complete = 1; |