die if failed allocating memory.
authoraland <aland>
Mon, 7 Jul 2003 19:02:48 +0000 (19:02 +0000)
committeraland <aland>
Mon, 7 Jul 2003 19:02:48 +0000 (19:02 +0000)
memset() data to 0.

src/modules/rlm_detail/rlm_detail.c

index 84549b8..6bf304b 100644 (file)
@@ -72,7 +72,11 @@ static int detail_instantiate(CONF_SECTION *conf, void **instance)
 {
        struct detail_instance *inst;
 
-       inst = rad_malloc(sizeof *inst);
+       inst = rad_malloc(sizeof(*inst));
+       if (!inst) {
+               return -1;
+       }
+       memset(inst, 0, sizeof(*inst));
 
        if (cf_section_parse(conf, inst, module_config) < 0) {
                free(inst);