From 488232b7ec7921753ec27ffd836a51f23afae0b8 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 26 Apr 2013 14:15:37 -0700 Subject: [PATCH] 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 --- lib/netlink-socket.c | 5 +---- 1 file changed, 1 insertion(+), 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) { -- 2.43.0