mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-08 04:30:45 -08:00
regex-emacs: fix leak on memory allocation failure
* src/regex-emacs.c (ENSURE_FAIL_STACK): If the failure stack cannot be grown, free locally-allocated storage before returning.
This commit is contained in:
parent
4c0a9754ac
commit
bd5771ff27
1 changed files with 5 additions and 1 deletions
|
|
@ -969,7 +969,11 @@ typedef struct
|
|||
#define ENSURE_FAIL_STACK(space) \
|
||||
while (REMAINING_AVAIL_SLOTS <= space) { \
|
||||
if (!GROW_FAIL_STACK (fail_stack)) \
|
||||
return -2; \
|
||||
{ \
|
||||
unbind_to (count, Qnil); \
|
||||
SAFE_FREE (); \
|
||||
return -2; \
|
||||
} \
|
||||
DEBUG_PRINT ("\n Doubled stack; size now: %td\n", fail_stack.size); \
|
||||
DEBUG_PRINT (" slots available: %td\n", REMAINING_AVAIL_SLOTS);\
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue