#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <math.h>
if (je) {
json_object_add_value_int(root, "eta", je->eta_sec);
json_object_add_value_int(root, "elapsed", je->elapsed_sec);
+ free(je);
}
if (opt_list)
* forever
*/
if (!iolog->cur_log_max) {
- new_samples = iolog->td->o.log_entries;
+ if (iolog->td)
+ new_samples = iolog->td->o.log_entries;
+ else
+ new_samples = DEF_LOG_ENTRIES;
} else {
new_samples = iolog->cur_log_max * 2;
if (new_samples > MAX_LOG_ENTRIES)