forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf81d50d
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 parent2f9907c commitf81d50d
2 files changed
+16
-11
lines changedLines changed: 15 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
| 279 | + | |
| 280 | + | |
| 281 | + | |
279 | 282 |
| |
280 | 283 |
| |
281 | 284 |
| |
| |||
1846 | 1849 |
| |
1847 | 1850 |
| |
1848 | 1851 |
| |
1849 |
| - | |
1850 |
| - | |
1851 |
| - | |
1852 |
| - | |
1853 |
| - | |
1854 |
| - | |
1855 |
| - | |
1856 |
| - | |
1857 |
| - | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1858 | 1864 |
| |
1859 | 1865 |
| |
1860 | 1866 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
185 |
| - | |
| 185 | + | |
186 | 186 |
| |
187 |
| - | |
188 | 187 |
| |
189 | 188 |
| |
190 | 189 |
| |
|
0 commit comments
Comments
(0)