diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-09-04 11:24:08 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-09-04 11:24:08 +0200 |
commit | daeeb8e982a3463f4a866e805b64f214d9f44160 (patch) | |
tree | 64888a5b01ab18f6ffca311af766c242f8c3b1bc /sysdep/unix | |
parent | 05198c12f48c9d4a65ee6d1d4117bd8067a71131 (diff) |
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.
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/io.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index a5e05222..99d33936 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -205,10 +205,6 @@ timer * tm_new(pool *p) { timer *t = ralloc(p, &tm_class); - t->hook = NULL; - t->data = NULL; - t->randomize = 0; - t->expires = 0; return t; } @@ -595,22 +591,9 @@ sk_new(pool *p) { sock *s = ralloc(p, &sk_class); s->pool = p; - s->data = NULL; - s->saddr = s->daddr = IPA_NONE; - s->sport = s->dport = 0; + // s->saddr = s->daddr = IPA_NONE; s->tos = s->ttl = -1; - s->flags = 0; - s->iface = NULL; - s->rbuf = NULL; - s->rx_hook = NULL; - s->rbsize = 0; - s->tbuf = NULL; - s->tx_hook = NULL; - s->tbsize = 0; - s->err_hook = NULL; s->fd = -1; - s->rbuf_alloc = s->tbuf_alloc = NULL; - s->password = NULL; return s; } |