diff options
author | Sabyasachi Sengupta <sabyasachi.sengupta@alcatel-lucent.com> | 2015-06-05 22:14:37 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-06-05 22:15:27 -0700 |
commit | 3da29e32942e9ad17bb8b37275eed38f78ed9fba (patch) | |
tree | 8249e14d5ae67b19b49d23008344f6368c6a5893 | |
parent | ea0797c929dc663ed443f07cd0bfc9d788d11367 (diff) | |
download | openvswitch-3da29e32942e9ad17bb8b37275eed38f78ed9fba.tar.gz |
ofproto-dpif: Use xzalloc instead of xmalloc.
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>
-rw-r--r-- | ofproto/ofproto-dpif.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index bd4530567..22e5d5f34 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -812,7 +812,7 @@ static int add_internal_flows(struct ofproto_dpif *); static struct ofproto * alloc(void) { - struct ofproto_dpif *ofproto = xmalloc(sizeof *ofproto); + struct ofproto_dpif *ofproto = xzalloc(sizeof *ofproto); return &ofproto->up; } @@ -1608,7 +1608,7 @@ query_tables(struct ofproto *ofproto, static struct ofport * port_alloc(void) { - struct ofport_dpif *port = xmalloc(sizeof *port); + struct ofport_dpif *port = xzalloc(sizeof *port); return &port->up; } @@ -3882,7 +3882,7 @@ static struct rule_dpif *rule_dpif_cast(const struct rule *rule) static struct rule * rule_alloc(void) { - struct rule_dpif *rule = xmalloc(sizeof *rule); + struct rule_dpif *rule = xzalloc(sizeof *rule); return &rule->up; } |