The setting_xml is now a regular string allocated on the
NMEM handle that is passed to hitsbytarget anyway.
if (settings && *settings == '1')
{
wrbuf_puts(c->wrbuf, "<settings>\n");
- wrbuf_puts(c->wrbuf, wrbuf_cstr(ht[i].settings_xml));
+ wrbuf_puts(c->wrbuf, ht[i].settings_xml);
wrbuf_puts(c->wrbuf, "</settings>\n");
}
wrbuf_puts(c->wrbuf, "</target>");
- wrbuf_destroy(ht[i].settings_xml);
}
wrbuf_puts(c->wrbuf, "</bytarget>");
res[*count].state = client_get_state_str(cl);
res[*count].connected = client_get_connection(cl) ? 1 : 0;
session_settings_dump(se, client_get_database(cl), w);
- res[*count].settings_xml = w;
+ res[*count].settings_xml = nmem_strdup(nmem, wrbuf_cstr(w));
+ wrbuf_destroy(w);
(*count)++;
}
session_leave(se);
int records;
const char *state;
int connected;
- WRBUF settings_xml;
+ char *settings_xml;
};
struct hitsbytarget *hitsbytarget(struct session *s, int *count, NMEM nmem);