format full path into variable, null terminate and free it after use
in hc_session_connected_callback
Type: fix
Change-Id: I3ed64dd247bf5ac9af8fa65517b6308a98205fd4
Signed-off-by: Matus Fabian <[email protected]>
hc_worker_t *wrk;
hc_session_t *hc_session;
hc_http_header_t *header;
+ u8 *f = 0;
if (err)
{
}
if (hcm->filename)
{
- hc_session->file_ptr =
- fopen ((char *) format (0, "/tmp/%v", hcm->filename), "w");
+ f = format (0, "/tmp/%s%c", hcm->filename, 0);
+ hc_session->file_ptr = fopen ((char *) f, "w");
+ vec_free (f);
if (hc_session->file_ptr == NULL)
{
vlib_process_signal_event_mt (wrk->vlib_main, hcm->cli_node_index,