-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak in typeset (rhbz#1036470)
A memory leak occurred when typeset was used in a function called from within a command substitution. This fix was backported from the 93v- beta by Red Hat on 22 Jan 2014. Source: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20120801-memlik3.patch src/cmd/ksh93/include/name.h, src/cmd/ksh93/sh/subshell.c: - Replace the nv_subsaved() function by the version from ksh 93v-. This version frees a table from memory if the NV_TABLE flag is passed in the new second parameter, a bitmask for flags (which was oddly named 'table'; I've renamed it to 'flags'). src/cmd/ksh93/sh/name.c: - nv_delete(): When calling nv_subsaved(), pass on the NV_TABLE flag if given. - table_unset(): Call nv_delete() with the NV_TABLE flag. src/cmd/ksh93/tests/leaks.sh: - Add test based on the reproducer provided in Red Hat bug 1036470.
- Loading branch information
Showing
4 changed files
with
37 additions
and
7 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
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
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
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