Initialize helper structure to 0s

We check the pointers that are part of this structure for NULL before
accessing them - but that means we need to zero out the structure for this
to work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-12-07 20:06:07 -08:00
parent dad93c425e
commit a72597189d

View file

@ -129,7 +129,7 @@ static struct uemis_helper *uemis_get_helper(int diveid)
php = &hp->next;
break;
}
hp = *php = malloc(sizeof(struct uemis_helper));
hp = *php = calloc(1, sizeof(struct uemis_helper));
hp->diveid = diveid;
hp->next = NULL;
return hp;