- Notifications
You must be signed in to change notification settings - Fork5
Commita39331f
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 parente8e2999 commita39331f
3 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
352 | 356 | | |
353 | 357 | | |
354 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| |||
0 commit comments
Comments
(0)