From: Michal Sojka Date: Thu, 12 Nov 2009 13:14:25 +0000 (+0100) Subject: Properly initialize newly allocated VRES X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/fwp.git/commitdiff_plain/c94e82b9e97e14fb3c3c68cced6fa93aa8899a41 Properly initialize newly allocated VRES --- diff --git a/fwp/lib/fwp/fwp_vres.c b/fwp/lib/fwp/fwp_vres.c index 3d593ef..9bc1b79 100644 --- a/fwp/lib/fwp/fwp_vres.c +++ b/fwp/lib/fwp/fwp_vres.c @@ -164,9 +164,11 @@ static inline void fwp_vres_free(fwp_vres_t *vres) */ fwp_vres_t *fwp_vres_alloc() { - fwp_vres_t *vres = malloc(sizeof(fwp_vres_t)); - if (vres) + fwp_vres_t *vres = malloc(sizeof(*vres)); + if (vres) { + memset(vres, 0, sizeof(*vres)); FWP_DEBUG("Allocated vres\n"); + } return vres; }