- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitba9eb29
committed
Fix low-probability memory leak in regex execution.
After an internal failure in shortest() or longest() while pinning down theexact location of a match, find() forgot to free the DFA structure beforereturning. This is pretty unlikely to occur, since we just successfullyran the "search" variant of the DFA; but it could happen, and it wouldresult in a session-lifespan memory leak since this code uses malloc()directly. Problem seems to have been aboriginal in Spencer's library,so back-patch all the way.In passing, correct a thinko in a comment I added awhile back about themeaning of the "ntree" field.I happened across these issues while comparing our code to Tcl's versionof the library.1 parentf7eeb32 commitba9eb29
1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
326 |
| - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
327 | 331 |
| |
328 | 332 |
| |
329 | 333 |
| |
|
0 commit comments
Comments
(0)