diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-07-15 13:28:09 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-07-15 13:28:09 -0400 |
commit | d6270e2df9f5fc8803d8171e0aad98a55257f921 (patch) | |
tree | 79e842d05143d144a7a7b7e6be64ce55a45249a0 /src/backend/utils/adt/xml.c | |
parent | d066cc548de7f21e84aeb27bd43388ba82534759 (diff) | |
download | postgresql-d6270e2df9f5fc8803d8171e0aad98a55257f921.tar.gz postgresql-d6270e2df9f5fc8803d8171e0aad98a55257f921.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/utils/adt/xml.c')
0 files changed, 0 insertions, 0 deletions