ofproto-dpif-sflow: Use xzalloc() instead of calloc() to allocate memory.
authorBen Pfaff <blp@nicira.com>
Wed, 16 Sep 2015 15:35:22 +0000 (08:35 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 16 Sep 2015 17:12:40 +0000 (10:12 -0700)
Memory allocation shouldn't be allowed to fail.

CC: Neil McKee <neil.mckee@inmon.com>
Reported-by: neeraj mehta <mehtaneeraj07@gmail.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-September/018776.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
AUTHORS
ofproto/ofproto-dpif-sflow.c

diff --git a/AUTHORS b/AUTHORS
index a7f40bb..b348942 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -385,6 +385,7 @@ ankur dwivedi           ankurengg2003@gmail.com
 chen zhang              3zhangchen9211@gmail.com
 kk yap                  yapkke@stanford.edu
 likunyun                kunyunli@hotmail.com
+neeraj mehta            mehtaneeraj07@gmail.com
 rahim entezari          rahim.entezari@gmail.com
 俊 赵                    zhaojun12@outlook.com
 冯全树(Crab)            fqs888@126.com
index 260c01b..d479997 100644 (file)
@@ -136,7 +136,7 @@ static void *
 sflow_agent_alloc_cb(void *magic OVS_UNUSED, SFLAgent *agent OVS_UNUSED,
                      size_t bytes)
 {
-    return calloc(1, bytes);
+    return xzalloc(bytes);
 }
 
 /* sFlow library callback to free memory. */