-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a realloc() memory leak which would happen when: - a previous allocation exists ('ptr' is non-NULL); and - the new 'size' is zero; and - a voluntary GC (or GC torture) causes the initial realloc() attempt to be bypassed In this case the slow path would incorrectly assume that it was entered after realloc() had returned a NULL, which for a zero new 'size' would mean that 'ptr' was successfully freed and no further action was necessary. But because the realloc() had actually been bypassed, this would cause the old 'ptr' to leak.
- Loading branch information
Showing
1 changed file
with
25 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters