WebServer: Fix memory leak - #203
Merged
Merged
Conversation
lighterowl
reviewed
Aug 8, 2020
gonosztopi
reviewed
Aug 8, 2020
gonosztopi
left a comment
Member
There was a problem hiding this comment.
I'd better check for ip being non-zero early to avoid allocating/deallocating memory unnecessary. Something like if (!ip) return; as the first line of the function, and then the check for ip is not necessary later.
Member
Author
|
@gonosztopi ok, done |
gonosztopi
approved these changes
Aug 8, 2020
ngosang
pushed a commit
to ngosang/amule
that referenced
this pull request
Jun 20, 2026
…ing under C locale (amule-project#203) Three binaries that previously did no locale init at all stayed on the default "C" locale for their whole lifetime, which made wxConvLibc (and unicode2char() in StringFunctions.cpp) collapse every non-ASCII codepoint into '?' or escape it. The classic symptom is a filename like "La.mujer.danesa.1x02.Un.niño.destrozado" surfacing as "La.mujer.danesa.1x02.Un.ni\361o" in amuled output, amulecmd, the web UI, etc. Common deployment trigger: Docker / systemd / cron with LANG/LC_ALL unset. Three call-sites: * src/amuled.cpp -- aMuleInitLocale() at the top of CamuleDaemonApp::Initialize(), right after wxAppConsole::Initialize returns and before any wxString -> char* conversion fires. * src/utils/fileview/FileView.cpp -- aMuleInitLocale() at the top of OnInitCmdLine() (CFileView has no OnInit override, so this is the earliest hook wxApp calls). * src/utils/cas/cas.c -- inline setlocale(LC_ALL, "") + LC_NUMERIC=C at the top of main(). cas is plain C, so calling the C++ helper would require linkage shimming for no real win; the inline pair matches the helper's policy verbatim. amule, amule-remote-gui, alc, alcc, and wxcas already drive locale through wxLocale (m_locale.Init() / InitLocale()), so they're left alone -- the wxLocale codepath calls setlocale internally and was never broken in the C-locale sense. amulecmd and amuleweb get migrated to the new helper in a follow-up commit so this commit's diff is just "add calls, no replace". Closes amule-org#203.
ngosang
pushed a commit
to ngosang/amule
that referenced
this pull request
Jun 20, 2026
i18n: fix non-ASCII mangling under default C locale (amule-project#203)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.