mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Clear memory allocated by ralloc().
This also fixes bug that timer->recurrent was not cleared in tm_new() and unexpected recurrence of startup timer in BGP confused state machine and caused crash.
This commit is contained in:
@@ -183,13 +183,14 @@ rdump(void *res)
|
||||
*
|
||||
* This function is called by the resource classes to create a new
|
||||
* resource of the specified class and link it to the given pool.
|
||||
* Size of the resource structure is taken from the @size field
|
||||
* of the &resclass.
|
||||
* Allocated memory is zeroed. Size of the resource structure is taken
|
||||
* from the @size field of the &resclass.
|
||||
*/
|
||||
void *
|
||||
ralloc(pool *p, struct resclass *c)
|
||||
{
|
||||
resource *r = xmalloc(c->size);
|
||||
bzero(r, c->size);
|
||||
|
||||
r->class = c;
|
||||
add_tail(&p->inside, &r->n);
|
||||
|
||||
Reference in New Issue
Block a user