Explicitly initialize all struct parameters on init

This commit is contained in:
Bert Vermeulen 2013-04-27 18:24:50 +02:00
parent 17f63de642
commit c2523f2213
1 changed files with 2 additions and 1 deletions

3
std.c
View File

@ -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;