From a72597189ddccf4e495b52d964d175477414abb9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 7 Dec 2012 20:06:07 -0800 Subject: 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 --- uemis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uemis.c') diff --git a/uemis.c b/uemis.c index 4306a1b55..e4a4adb21 100644 --- a/uemis.c +++ b/uemis.c @@ -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; -- cgit v1.2.3-70-g09d2