diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-07-15 13:28:01 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-07-15 13:28:01 -0400 |
commit | 1116c9d1e7a5c06636b172bb49bbe1e91edb6076 (patch) | |
tree | 653019dea22d5af705e094d256ae95e7142fe167 /src/backend/commands/indexcmds.c | |
parent | eb972f3eca22858683a6b40466f6d561262b268b (diff) | |
download | postgresql-1116c9d1e7a5c06636b172bb49bbe1e91edb6076.tar.gz postgresql-1116c9d1e7a5c06636b172bb49bbe1e91edb6076.zip |
Prevent corner-case core dump in rfree().
rfree() failed to cope with the case that pg_regcomp() had initialized the
regex_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 the
guts struct anyway, and thus dump core. This is a sufficiently narrow
corner 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 a
failure return from pg_regcomp. Other than this bug, it turns out we
don't, so adjust comments appropriately.
Diffstat (limited to 'src/backend/commands/indexcmds.c')
0 files changed, 0 insertions, 0 deletions