Review Board 1.7.16

va_args cleanup in res_config_odbc, res_config_curl, utils, and also res_config_pgsql

Review Request #1848 - Created April 5, 2012 and submitted

Jonathan Rose
mjordan, mmichelson, wdoekes
A number of va_copy operations weren't matched with a corresponding va_end in res_config_odbc. Also, there was a potential for va_end to be invoked twice on the same va_arg in utils, which would mean invoking va_end on an undefined variable... which is bad.

va_end is removed from various functions in config_pgsql and config_curl since they aren't making their own copy.  The invokers of those functions are responsible for calling va_end on them.
None to speak of.  It compiles, but I'm really not sure how to check for va_arg leaks and such.  I'm not too worried about res_config_odbc and utils since those changes are pretty self-contained. The other changes should be fine too since the paramater ap in res_config_odbc isn't ended in any of the adapter functions there. I'm a little wary though that they should be copying to a new va_arg list instead like res_config_odbc does.
Review request changed
Updated (April 6, 2012, 3:47 a.m.)
Updated res_config_odbc per what wdoekes said.  Also caught another misused va_end in the require function.
Ship it!
Posted (April 17, 2012, 10:07 a.m.)
Looks good to me.

Apart from addons/res_config_mysql.c, I think you got them all. runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to