git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d121c7
)
netlink-socket: Use xmalloc() instead of malloc().
author
Ben Pfaff
<blp@nicira.com>
Fri, 26 Apr 2013 21:15:37 +0000
(14:15 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Mon, 29 Apr 2013 22:05:56 +0000
(15:05 -0700)
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>
lib/netlink-socket.c
patch
|
blob
|
history
diff --git
a/lib/netlink-socket.c
b/lib/netlink-socket.c
index
a9e68fa
..
fbb1724
100644
(file)
--- 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) {