X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fols.c;h=7feb4db96cad4c6f5ffcb8c2ef78a8a9575013b4;hb=91219afc75c9aa1d0c5e2da5c03343c1e43eb6df;hp=8d68bdaf91e728639bd560c6c0474fb6fe51a280;hpb=c368e6f3d248a73d69cd0c2c4a7c88a92def55e3;p=libsigrok.git diff --git a/src/output/ols.c b/src/output/ols.c index 8d68bdaf..7feb4db9 100644 --- a/src/output/ols.c +++ b/src/output/ols.c @@ -44,12 +44,8 @@ static int init(struct sr_output *o, GHashTable *options) (void)options; - if (!(ctx = g_try_malloc(sizeof(struct context)))) { - sr_err("%s: ctx malloc failed", __func__); - return SR_ERR_MALLOC; - } + ctx = g_malloc0(sizeof(struct context)); o->priv = ctx; - ctx->samplerate = 0; ctx->num_samples = 0;