]> 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 19:46:48 +0000 (19:46 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Tue, 27 May 2014 19:46:48 +0000 (19:46 +0000)
commit7041eee5e5f0ef615bd646709405899005f358ec
treeb79e87d5bb9c86fd12adac459342c1d571463c66
parentf992988b1fb461bc18e0e7d523464b9975c49ce7
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

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