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

Memory allocation fail then return NULL? #104

Closed
Hojun-Cho opened this issue Jul 11, 2023 · 1 comment
Closed

Memory allocation fail then return NULL? #104

Hojun-Cho opened this issue Jul 11, 2023 · 1 comment

Comments

@Hojun-Cho
Copy link
Contributor

I am looking at your code with great interest. It's quite interesting!
The code below does not check to see if it returns NULL. There are a few more such codes.
I'll create a PR if you need to.

char *buf = (char *) malloc(sizeof(char) * (len + 1));

newstr = (char *) malloc(maxstrlen + 1);

newstr = (char *) malloc(maxstrlen + 1);

char *buf = (char *) malloc(sizeof(char) * (len + 1));

@wolkykim
Copy link
Owner

wolkykim commented Jul 11, 2023

PRs are always welcome! They need the check.

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