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

Incorrect argument to malloc #91

Closed
sdevlin opened this issue Feb 18, 2022 · 2 comments
Closed

Incorrect argument to malloc #91

sdevlin opened this issue Feb 18, 2022 · 2 comments

Comments

@sdevlin
Copy link

sdevlin commented Feb 18, 2022

https://github.com/skeeto/emacsql/blob/c82a0e6b4d256a3743b718cfb640fa9efc045f6e/sqlite/emacsql.c#L45

In the referenced code, the argument to malloc is incorrect. Both the type and the variable are named buffer, but sizeof prefers the variable. Since the variable is a pointer, only the size of a pointer is allocated.

@skeeto skeeto closed this as completed in 3747260 Feb 18, 2022
@skeeto
Copy link
Collaborator

skeeto commented Feb 18, 2022 via email

@sdevlin
Copy link
Author

sdevlin commented Feb 18, 2022

No problem, I've surely written similar code as well. 🙂

Thanks for the quick fix!

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