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

Missing malloc NULL checks #8

Open
johnramsden opened this issue Oct 25, 2020 · 1 comment
Open

Missing malloc NULL checks #8

johnramsden opened this issue Oct 25, 2020 · 1 comment

Comments

@johnramsden
Copy link
Collaborator

Anytime malloc is called, the result should be checked in case it is NULL and ENOMEM occurred.

buffers=(struct embedding_buffer**)malloc(NR_TABLES*sizeof(struct embedding_buffer*));

buffers = malloc(NR_TABLES*sizeof(struct embedding_buffer*)); 
if (buffers == NULL) {
   // ...
}
@nzarif
Copy link
Collaborator

nzarif commented Oct 28, 2020

That is true. Thanks

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