]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Properly initialize newly allocated VRES
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 12 Nov 2009 13:14:25 +0000 (14:14 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 12 Nov 2009 13:14:25 +0000 (14:14 +0100)
fwp/lib/fwp/fwp_vres.c

index 3d593efb9ec0e0f95f09326c4d53ed57e4847b0a..9bc1b79b19cccefbf78d3fcab7611fa13713f11d 100644 (file)
@@ -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;
 }