hotfix: clear memory after allocation
Cedric, in my opinion this is no fix. If the allocation fails, this will directly lead to a segfault (you are testing for a successful allocation afterwards). Furthermore, in  you criticized that the logic was strange because this init function would not always allocate memory, but this function does exactly this(!). In fact, the current version does the same as what I proposed but is more ugly.
The bug with FlexRAN possibly accessing memory between
bzero()is still in there, which is also addressed by .
Agreed, I failed. The Assert should be done before bzero.
It is a quick and dirty solution to remove the crash some people had before I left for holidays. Was done in a hurry. Not good.
I don't think memory is always allocated. It is done only the first time the function is called, no? (let's forget about multi-threads for a second)
For flexran that uses the structure before it is created, I'll let you deal with it.
Your work will go to develop, that is for sure. This was really a quick and dirty fix before holidays. And it "works", I tested it: before => crash, after => no crash.