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 (throw-based) allocFunc for zlib1. Possible memory leak. [CORE6221] #6465

Closed
firebird-issue-importer opened this issue Jan 10, 2020 · 6 comments

Comments

@firebird-issue-importer

Submitted by: @ibprovider

https://www.zlib.net/manual.html

Usage of z_stream_s structure: zalloc must return Z_NULL if there is not enough memory for the object.

Firebird code, if I understood correctly, assign to zalloc throw-based allocation func:

void* allocFunc(void*, uInt items, uInt size)
{
return MemoryPool::globalAlloc(items * size ALLOC_ARGS); //thow ?
}

In deflateInit, for example, has five calls of zalloc function and has rollback of initialization if second (and next) call of zalloc return nullptr.

Commits: d27a422 908c660

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @ibprovider

summary: Incorrect (throw-based) alloFunc for zlib1. Possible memory leak. => Incorrect (throw-based) allocFunc for zlib1. Possible memory leak.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @ibprovider

description: https://www.zlib.net/manual.html

Usage of z_stream_s structure: zalloc must return Z_NULL if there is not enough memory for the object.

Firebird code, if I understood correctly, assign to zalloc throw-based allocation func:

void* allocFunc(void*, uInt items, uInt size)
{
return MemoryPool::globalAlloc(items * size ALLOC_ARGS); //thow ?
}

In deflateInit, for example, has five calls of zalloc functions and has rollback of initialization if second (and next) call of zalloc return nullptr.

=>

https://www.zlib.net/manual.html

Usage of z_stream_s structure: zalloc must return Z_NULL if there is not enough memory for the object.

Firebird code, if I understood correctly, assign to zalloc throw-based allocation func:

void* allocFunc(void*, uInt items, uInt size)
{
return MemoryPool::globalAlloc(items * size ALLOC_ARGS); //thow ?
}

In deflateInit, for example, has five calls of zalloc function and has rollback of initialization if second (and next) call of zalloc return nullptr.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @pavel-zotov

status: Open [ 1 ] => Open [ 1 ]

QA Status: No test => Cannot be tested

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @AlexPeshkoff

Version: 4.0 Beta 1 [ 10750 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

Fix Version: 3.0.6 [ 10889 ]

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

Successfully merging a pull request may close this issue.

None yet
2 participants