From: Bert Vermeulen Date: Sat, 27 Apr 2013 16:24:50 +0000 (+0200) Subject: Explicitly initialize all struct parameters on init X-Git-Tag: dsupstream~36 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c2523f221364c0df51b8093693a246a713633912;p=libsigrok.git Explicitly initialize all struct parameters on init --- diff --git a/std.c b/std.c index 03e9db4f..8add0d3d 100644 --- a/std.c +++ b/std.c @@ -47,12 +47,13 @@ SR_PRIV int std_hw_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, return SR_ERR_ARG; } - if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) { + if (!(drvc = g_try_malloc(sizeof(struct drv_context)))) { sr_err("%sDriver context malloc failed.", prefix); return SR_ERR_MALLOC; } drvc->sr_ctx = sr_ctx; + drvc->instances = NULL; di->priv = drvc; return SR_OK;