netlink-socket: Use xmalloc() instead of malloc().
[sliver-openvswitch.git] / lib / netlink-socket.c
index a9e68fa..fbb1724 100644 (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) {