-
Notifications
You must be signed in to change notification settings - Fork 66
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
dbfopen: fix possible memory leaks when using realloc #166
base: master
Are you sure you want to change the base?
Conversation
I found the build process very confusing and instructions from README were I believe of older versions. I confess that my autoconf knowledge isn't great. Had to try lot of things before able to build the repository. Maybe, I'll open a different PR for that. Tests done:
Let me know if there are any more tests I can do. Thanks. |
80f78f7
to
b7432a6
Compare
Changes:
|
char *, realloc(psDBF->pszHeader, psDBF->nFields * XBASE_FLDHDR_SZ)); | ||
|
||
if (!psDBF_char_realloc_ptr) | ||
{ | ||
return FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there would be much more work to restore the psDBF state to a consistente state... I'm afraid that the best in that method would be to just "assert(false); return FALSE;" on failed memory allocations. Probably the same in DBFAlterFieldDefn()
Fixes OSGeo#165 Signed-off-by: Mohan Yelugoti <[email protected]>
@thbeu your review would be appreciated |
Co-authored-by: Even Rouault <[email protected]>
Fixes #165