]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_config_odbc: Fix old and new ast_string_field memory leaks.
authorWalter Doekes <walter+asterisk@wjd.nu>
Tue, 27 May 2014 20:02:06 +0000 (20:02 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Tue, 27 May 2014 20:02:06 +0000 (20:02 +0000)
commit01332cad9b69e272b0b1ee35f0152c3d723afb22
treed22c1dfd27cf2401778fb48b725b21219c4420f9
parentaf9c05456e5b58a07e87692f50db0b174ed351c4
res_config_odbc: Fix old and new ast_string_field memory leaks.

The ODBC realtime driver uses ^NN parameter encoding to cope with the
special meaning of the semi-colon. A semi-colon in a field is
interpreted as if the key was supplied twice, something which isn't
otherwise possible with fixed database columns. E.g. allow=alaw;ulaw
is parsed as allow=alaw and allow=ulaw. A literal semi-colon is
rewritten to ^3B when stored in the database.

The module uses a stringfield to efficiently store the encoded
parameters. However, this stringfield wasn't always freed in some
off-nominal cases.

Commit r413241 fixed initialization so the encoding for INSERT and
DELETE queries wouldn't crash. (Only SELECTs and UPDATEs worked
apparently.) But that commit forgot the frees. This change cleans
that up.

Review: https://reviewboard.asterisk.org/r/3555/
........

Merged revisions 414564 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 414565 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_config_odbc.c