When the processing of columns of text lines detected errors, the loop
was aborted and the routine was left, but allocated resources were not
freed. Fix the remaining memory leaks in the error code paths.
columns = parse_line(line, inc, max_columns);
if (!columns) {
sr_err("Error while parsing line %zu.", inc->line_number);
+ g_strfreev(lines);
return SR_ERR;
}
num_columns = g_strv_length(columns);
sr_err("Column %u in line %zu is out of bounds.",
inc->first_column, inc->line_number);
g_strfreev(columns);
+ g_strfreev(lines);
return SR_ERR;
}
/*
sr_err("Not enough columns for desired number of channels in line %zu.",
inc->line_number);
g_strfreev(columns);
+ g_strfreev(lines);
return SR_ERR;
}
ret = parse_single_column(columns[0], inc);
if (ret != SR_OK) {
g_strfreev(columns);
+ g_strfreev(lines);
return SR_ERR;
}
if (ret != SR_OK) {
sr_err("Sending samples failed.");
g_strfreev(columns);
+ g_strfreev(lines);
return SR_ERR;
}