check & memset
authoraland <aland>
Fri, 11 Jul 2003 19:51:34 +0000 (19:51 +0000)
committeraland <aland>
Fri, 11 Jul 2003 19:51:34 +0000 (19:51 +0000)
src/modules/rlm_counter/rlm_counter.c
src/modules/rlm_pam/rlm_pam.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
index 70ca021..c6abc78 100644 (file)
@@ -71,6 +71,10 @@ static int pam_instantiate(CONF_SECTION *conf, void **instance)
        rlm_pam_t *data;
 
        data = rad_malloc(sizeof(*data));
+       if (!data) {
+               return -1;
+       }
+       memset(data, 0, sizeof(*data));
 
        if (cf_section_parse(conf, data, module_config) < 0) {
                free(data);