mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
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>
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user