check & memset
[freeradius.git] / src / modules / rlm_counter / rlm_counter.c
index 4ee61a3..41d89da 100644 (file)
@@ -311,6 +311,10 @@ static int counter_instantiate(CONF_SECTION *conf, void **instance)
         *      Set up a storage area for instance data
         */
        data = rad_malloc(sizeof(*data));
+       if (!data) {
+               return -1;
+       }
+       memset(data, 0, sizeof(*data));
 
        /*
         *      If the configuration parameters can't be parsed, then