summaryrefslogtreecommitdiff
path: root/res/res_config_curl.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-04-17 21:10:50 +0000
committerJonathan Rose <jrose@digium.com>2012-04-17 21:10:50 +0000
commitf88a632d96bb3ed76976b2f32f5d7b7e8591afa9 (patch)
treeaf95e26373900d175d853edbc817658fa205acbe /res/res_config_curl.c
parent3934b0478d4962a81fcc5d20b75dbfc3aceb398e (diff)
Make use of va_args more appropriate to form in various res_config modules plus utils.
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. (issue ASTERISK-19451) Reported by: Walter Doekes Review: https://reviewboard.asterisk.org/r/1848/ ........ Merged revisions 362354 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362357 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_curl.c')
-rw-r--r--res/res_config_curl.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/res/res_config_curl.c b/res/res_config_curl.c
index bb8d9b39b..43fe888ed 100644
--- a/res/res_config_curl.c
+++ b/res/res_config_curl.c
@@ -88,7 +88,6 @@ static struct ast_variable *realtime_curl(const char *url, const char *unused, v
ast_uri_encode(newval, buf2, sizeof(buf2), ast_uri_http);
ast_str_append(&query, 0, "%s%s=%s", i > 0 ? "&" : "", buf1, buf2);
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
ast_str_substitute_variables(&buffer, 0, NULL, ast_str_buffer(query));
@@ -168,7 +167,6 @@ static struct ast_config *realtime_multi_curl(const char *url, const char *unuse
ast_uri_encode(newval, buf2, sizeof(buf2), ast_uri_http);
ast_str_append(&query, 0, "%s%s=%s", i > 0 ? "&" : "", buf1, buf2);
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
@@ -258,7 +256,6 @@ static int update_curl(const char *url, const char *unused, const char *keyfield
ast_uri_encode(newval, buf2, sizeof(buf2), ast_uri_http);
ast_str_append(&query, 0, "%s%s=%s", i > 0 ? "&" : "", buf1, buf2);
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
ast_str_substitute_variables(&buffer, 0, NULL, ast_str_buffer(query));
@@ -317,7 +314,6 @@ static int update2_curl(const char *url, const char *unused, va_list ap)
ast_str_append(&query, 0, "%s%s=%s", first ? "" : "&", buf1, buf2);
first = 0;
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
/* Proxies work, by setting CURLOPT options in the [globals] section of
@@ -382,7 +378,6 @@ static int store_curl(const char *url, const char *unused, va_list ap)
ast_uri_encode(newval, buf2, sizeof(buf2), ast_uri_http);
ast_str_append(&query, 0, "%s%s=%s", i > 0 ? "&" : "", buf1, buf2);
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
ast_str_substitute_variables(&buffer, 0, NULL, ast_str_buffer(query));
@@ -446,7 +441,6 @@ static int destroy_curl(const char *url, const char *unused, const char *keyfiel
ast_uri_encode(newval, buf2, sizeof(buf2), ast_uri_http);
ast_str_append(&query, 0, "%s%s=%s", i > 0 ? "&" : "", buf1, buf2);
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
ast_str_substitute_variables(&buffer, 0, NULL, ast_str_buffer(query));
@@ -507,7 +501,6 @@ static int require_curl(const char *url, const char *unused, va_list ap)
type == RQ_FLOAT ? "float" :
"unknown", size);
}
- va_end(ap);
ast_str_append(&query, 0, ")}");
ast_str_substitute_variables(&buffer, 0, NULL, ast_str_buffer(query));