mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user