diff options
author | Ben Pfaff <blp@nicira.com> | 2013-04-26 14:15:37 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-04-29 15:05:56 -0700 |
commit | 488232b7ec7921753ec27ffd836a51f23afae0b8 (patch) | |
tree | 1919fbf088cc24dd804b3b37afeb8c9e87c4c781 | |
parent | 0d121c735093ada40dfd2aa5cdba36d27c6b8389 (diff) | |
download | openvswitch-488232b7ec7921753ec27ffd836a51f23afae0b8.tar.gz |
netlink-socket: Use xmalloc() instead of malloc().
This was the only obvious use of bare malloc() in the tree, other
than in the implementation of wrapper functions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r-- | lib/netlink-socket.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index a9e68fa9d..fbb1724f5 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -110,10 +110,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp) } *sockp = NULL; - sock = malloc(sizeof *sock); - if (sock == NULL) { - return ENOMEM; - } + sock = xmalloc(sizeof *sock); sock->fd = socket(AF_NETLINK, SOCK_RAW, protocol); if (sock->fd < 0) { |