unix runmode: improve JSON handling

The jansson function with new in their name take care of ref
counting. The this patch fixes a memory leak.
pull/215/head
Eric Leblond 12 years ago
parent 195b144daa
commit 6b3ebc810d

@ -97,7 +97,7 @@ static TmEcode UnixSocketPcapFilesList(json_t *cmd, json_t* answer, void *data)
return TM_ECODE_FAILED;
}
TAILQ_FOREACH(file, &this->files, next) {
json_array_append(jarray, json_string(file->filename));
json_array_append_new(jarray, json_string(file->filename));
i++;
}
json_object_set_new(jdata, "count", json_integer(i));

Loading…
Cancel
Save