[asterisk-dev] cdr_odbc.c is broken in trunk
Michiel van Baak
michiel at vanbaak.info
Thu Jan 10 05:43:33 CST 2008
On 11:18, Thu 10 Jan 08, Nick Gorham wrote:
> Hi,
>
> The change to use prepare_cb() in odbc_log became broken in r88182.
>
> The code calls SQLBindParameter on a local variable (timestr) but as it
> now doesn't call SQLExecute in the same function when it finally gets to
> SQLExecute that variable is out of scope.
>
> I dont know if I can pass attachments to this list, so the fixed cdr can
> be found here http://www.lurcher.org/~nick/cdr_odbc.c
>
> The code contained the following lines
>
> /* We really should only have to do this once. But for some
> * strange reason if I don't it blows holes in memory like
> * like a shotgun. So we just do this so its safe.
> */
>
> The "strange reason", as I have tried to report several times now via
> the forum, is that the memory passed to SQLBindParameter is not
> referenced until the SQLExecute, that the point of binding parameters,
> you pass the address of the storage, then before the SQLExecute you set
> the values you intend to use.
Hi,
Can you post this to http://bugs.digium.com with a unified
diff as the patch ?
Thank you.
--
Michiel van Baak
michiel at vanbaak.eu
http://michiel.vanbaak.eu
GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD
"Why is it drug addicts and computer afficionados are both called users?"
More information about the asterisk-dev
mailing list