}
if (in->module->init && in->module->init(in, new_opts) != SR_OK) {
- g_hash_table_destroy(new_opts);
g_free(in);
in = NULL;
}
if (new_opts)
g_hash_table_destroy(new_opts);
+ in->buf = g_string_sized_new(128);
return in;
}
/* Found a matching module. */
in = sr_input_new(imod, NULL);
- in->buf = g_string_new_len(buf->str, buf->len);
+ g_string_insert_len(in->buf, 0, buf->str, buf->len);
break;
}
/* Found a matching module. */
in = sr_input_new(imod, NULL);
- in->buf = g_string_new_len(buf->str, buf->len);
+ g_string_insert_len(in->buf, 0, buf->str, buf->len);
break;
}
if (!in && buf)