From 5ee0094057dab5fb7e289aa6c2a34d2728a51698 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sat, 31 Jul 2010 18:58:56 +0200 Subject: libdect: zero libdect handle on allocation Zero the DECT handle on allocation to properly initialize the various members. Signed-off-by: Patrick McHardy --- src/libdect.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/libdect.c b/src/libdect.c index b89eec5..f70100e 100644 --- a/src/libdect.c +++ b/src/libdect.c @@ -34,6 +34,8 @@ struct dect_handle *dect_alloc_handle(struct dect_ops *ops) dh = ops->malloc(sizeof(*dh)); if (dh == NULL) return NULL; + memset(dh, 0, sizeof(*dh)); + dh->ops = ops; init_list_head(&dh->links); init_list_head(&dh->mme_list); -- cgit v1.2.3