Use xzalloc instead of xmalloc for some key structure allocations in
ofproto-dpif (viz. ofproto_dpif, ofport_dpif and rule_dpif) so as to
prevent uninitialized values in these structures.
Signed-off-by: Sabyasachi Sengupta <sabyasachi.sengupta@alcatel-lucent.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
static struct ofproto *
alloc(void)
{
- struct ofproto_dpif *ofproto = xmalloc(sizeof *ofproto);
+ struct ofproto_dpif *ofproto = xzalloc(sizeof *ofproto);
return &ofproto->up;
}
static struct ofport *
port_alloc(void)
{
- struct ofport_dpif *port = xmalloc(sizeof *port);
+ struct ofport_dpif *port = xzalloc(sizeof *port);
return &port->up;
}
static struct rule *
rule_alloc(void)
{
- struct rule_dpif *rule = xmalloc(sizeof *rule);
+ struct rule_dpif *rule = xzalloc(sizeof *rule);
return &rule->up;
}