]> sigrok.org Git - libsigrok.git/commitdiff
Explicitly initialize all struct parameters on init
authorBert Vermeulen <redacted>
Sat, 27 Apr 2013 16:24:50 +0000 (18:24 +0200)
committerBert Vermeulen <redacted>
Sat, 27 Apr 2013 16:24:50 +0000 (18:24 +0200)
std.c

diff --git a/std.c b/std.c
index 03e9db4f9f4a8dccf85445dbd6bcd6fc46dc415d..8add0d3dc622c2045cfa5c870efb4ab39183dde7 100644 (file)
--- 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;