2
0
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:
Ben Pfaff
2013-04-26 14:15:37 -07:00
parent 0d121c7350
commit 488232b7ec

View File

@@ -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) {