Commit 80c925c
committed
Avoid multiple free_struct_lconv() calls on same data.
A failure partway through PGLC_localeconv() led to a situation where
the next call would call free_struct_lconv() a second time, leading
to free() on already-freed strings, typically leading to a core dump.
Add a flag to remember whether we need to do that.
Per report from Thom Brown. His example case only provokes the failure
as far back as 9.4, but nonetheless this code is obviously broken, so
back-patch to all supported branches.1 parent f6a6057 commit 80c925c
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | 390 | | |
394 | 391 | | |
395 | 392 | | |
| |||
441 | 438 | | |
442 | 439 | | |
443 | 440 | | |
| 441 | + | |
444 | 442 | | |
445 | 443 | | |
446 | 444 | | |
| |||
457 | 455 | | |
458 | 456 | | |
459 | 457 | | |
460 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
| |||
521 | 524 | | |
522 | 525 | | |
523 | 526 | | |
524 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
525 | 530 | | |
526 | 531 | | |
527 | 532 | | |
| |||
534 | 539 | | |
535 | 540 | | |
536 | 541 | | |
| 542 | + | |
537 | 543 | | |
538 | 544 | | |
539 | 545 | | |
| |||
0 commit comments