diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-12-07 20:06:07 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-12-07 20:06:07 -0800 |
commit | a72597189ddccf4e495b52d964d175477414abb9 (patch) | |
tree | fdbc615c1789684323b392aff7fd1fc08f024b2c /uemis.c | |
parent | dad93c425ed74cf770db4212bffae0eeb363bcf3 (diff) | |
download | subsurface-a72597189ddccf4e495b52d964d175477414abb9.tar.gz |
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>
Diffstat (limited to 'uemis.c')
-rw-r--r-- | uemis.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |