Skip to content
Snippets Groups Projects
Commit 54d09093 authored by rswindell's avatar rswindell
Browse files

Fixed uninitialized pointer free (usrsub[i] and usrdir[i]) if a message group...

Fixed uninitialized pointer free (usrsub[i] and usrdir[i]) if a message group or library is configured by no sub-boards or directories are configured.
parent cda254ea
No related branches found
No related tags found
No related merge requests found
......@@ -1716,7 +1716,7 @@ bool sbbs_t::init()
return(false);
}
if((usrsub=(uint **)MALLOC(sizeof(uint *)*cfg.total_grps))==NULL) {
if((usrsub=(uint **)calloc(cfg.total_grps,sizeof(uint *)))==NULL) {
errormsg(WHERE, ERR_ALLOC, "usrsub", sizeof(uint)*cfg.total_grps);
return(false);
}
......@@ -1784,7 +1784,7 @@ bool sbbs_t::init()
return(false);
}
if((usrdir=(uint **)MALLOC(sizeof(uint *)*cfg.total_libs))==NULL) {
if((usrdir=(uint **)calloc(cfg.total_libs,sizeof(uint *)))==NULL) {
errormsg(WHERE, ERR_ALLOC, "usrdir", sizeof(uint)*cfg.total_libs);
return(false);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment