forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd6270e2
committed
Prevent corner-case core dump in rfree().
rfree() failed to cope with the case that pg_regcomp() had initialized theregex_t struct but then failed to allocate any memory for re->re_guts (ie,the first malloc call in pg_regcomp() failed). It would try to touch theguts struct anyway, and thus dump core. This is a sufficiently narrowcorner case that it's not surprising it's never been seen in the field;but still a bug is a bug, so patch all active branches.Noted while investigating whether we need to call pg_regfree after afailure return from pg_regcomp. Other than this bug, it turns out wedon't, so adjust comments appropriately.1 parentd066cc5 commitd6270e2
2 files changed
+16
-11
lines changedLines changed: 15 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
278 | 278 |
| |
279 | 279 |
| |
280 | 280 |
| |
| 281 | + | |
| 282 | + | |
| 283 | + | |
281 | 284 |
| |
282 | 285 |
| |
283 | 286 |
| |
| |||
1853 | 1856 |
| |
1854 | 1857 |
| |
1855 | 1858 |
| |
1856 |
| - | |
1857 |
| - | |
1858 |
| - | |
1859 |
| - | |
1860 |
| - | |
1861 |
| - | |
1862 |
| - | |
1863 |
| - | |
1864 |
| - | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
1865 | 1871 |
| |
1866 | 1872 |
| |
1867 | 1873 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
190 |
| - | |
| 190 | + | |
191 | 191 |
| |
192 |
| - | |
193 | 192 |
| |
194 | 193 |
| |
195 | 194 |
| |
|
0 commit comments
Comments
(0)