#include <string.h>
#include <glib.h>
#include <sigrok.h>
+#include <sigrok-internal.h>
static gpointer new_chunk(struct sr_datastore **ds);
if (unitsize <= 0)
return SR_ERR; /* TODO: Different error? */
- if (!(*ds = g_malloc(sizeof(struct sr_datastore))))
+ if (!(*ds = g_try_malloc(sizeof(struct sr_datastore)))) {
+ sr_err("ds: %s: ds malloc failed", __func__);
return SR_ERR_MALLOC;
+ }
(*ds)->ds_unitsize = unitsize;
(*ds)->num_units = 0;