*/
void astman_append(struct mansession *s, const char *fmt, ...)
{
+ int res;
va_list ap;
struct ast_str *buf;
}
va_start(ap, fmt);
- ast_str_set_va(&buf, 0, fmt, ap);
+ res = ast_str_set_va(&buf, 0, fmt, ap);
va_end(ap);
+ if (res == AST_DYNSTR_BUILD_FAILED) {
+ return;
+ }
if (s->f != NULL || s->session->f != NULL) {
send_string(s, ast_str_buffer(buf));
void astman_send_error_va(struct mansession *s, const struct message *m, const char *fmt, ...)
{
+ int res;
va_list ap;
struct ast_str *buf;
char *msg;
}
va_start(ap, fmt);
- ast_str_set_va(&buf, 0, fmt, ap);
+ res = ast_str_set_va(&buf, 0, fmt, ap);
va_end(ap);
+ if (res == AST_DYNSTR_BUILD_FAILED) {
+ return;
+ }
/* astman_append will use the same underlying buffer, so copy the message out
* before sending the response */
struct documentation_tree *doctree;
RAII_VAR(struct ast_str *, xpath_str, ast_str_create(128), ast_free);
va_list ap;
+ int res;
if (!xpath_str) {
return NULL;
}
va_start(ap, fmt);
- ast_str_set_va(&xpath_str, 0, fmt, ap);
+ res = ast_str_set_va(&xpath_str, 0, fmt, ap);
va_end(ap);
+ if (res == AST_DYNSTR_BUILD_FAILED) {
+ return NULL;
+ }
AST_RWLIST_RDLOCK(&xmldoc_tree);
AST_LIST_TRAVERSE(&xmldoc_tree, doctree, entry) {