-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Update TSRM/tsrm_win32.c #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This update fixes the handle leak described here - https://bugs.php.net/bug.php?id=62444 We have to initialize the local thread_token variable to prevent closing some 'random' handle. And at the end of the function we have to use CloseHandle to free the resources we might have obtained, to prevent the leak.
it will be better if you also attach this patch to the bug entry ;) thanks |
Not sure what is funny, this problem causes headaches to many users. Also not sure about the patch file format, so ... could you check please? |
git diff > bug62444.patch then attach that patch, done :) |
try download this:
or in your branch:
you will get a patch file |
@@ -363,6 +363,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC) | |||
} | |||
|
|||
Finished: | |||
if(thread_token != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, according to the CS, there should a space after if
oh, I saw you have commented about the fix in that bug entry, sounds okey to me. ingore the patch attaching thing. thanks |
Guys, I am doing this for the first time. I do not have GIT, I am not familiar with how PHP bugs are being solved, nor with its code style. The code I have submitted was created in style of the code I have made the change into. If someone created the original code in wrong style then I am sorry but I can not really do anything about it. I just have a server here that is freaking out because of this problem. Everyday 10000 handles leak and we do not even have some real traffic. I have submitted the patch using the common DIFF, not GIT DIFF. If this is wrong, PLEASE could someone create the actual PATCH file that is what is needed. Thank you1 |
karzyest, sorry for that. it's okey now. thanks for your work. ;) |
Thank you for your help. I am looking forward to a new version of PHP to have this fixed. |
Comment on behalf of laruence at php.net: patch merged. thanks |
fixed at : 3fe3029 |
This update fixes the handle leak described here - https://bugs.php.net/bug.php?id=62444
We have to initialize the local thread_token variable to prevent closing some 'random' handle. And at the end of the function we have to use CloseHandle to free the resources we might have obtained, to prevent the leak.