Skip to content
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

bool Param::open(const char *arg, const Option *opts) will cause memory leaks #9

Open
CoderHJZhao opened this issue Apr 22, 2024 · 1 comment
Assignees

Comments

@CoderHJZhao
Copy link

CoderHJZhao commented Apr 22, 2024

**fileName: param
methodName: bool Param::open(const char arg, const Option opts)

The Xcode profile tool detects memory leaks in this method, which causes continuous memory growth and overheating of the phone. I hope you can optimize this issue when you have time. Thank you!
`char *string=ptr[2];
if (string!=NULL) {
std::string str(string);
size_t f=str.find("%20");

while (f != std::string::npos) {
    str.replace(f, std::string("%20").length(), " ");
    f=str.find("%20");
}

char *file= new char[str.size()+1];
sprintf(file, "%s",str.c_str());
ptr[2]=file;

}
`

@shinjukunian shinjukunian self-assigned this May 22, 2024
@shinjukunian
Copy link
Owner

#f0abf60 should address this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants