summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/tipc/discover.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index ada42e436f5e..bd35c4a0746f 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -348,8 +348,10 @@ int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest)
return -ENOMEM;
req->buf = tipc_buf_acquire(INT_H_SIZE);
- if (!req->buf)
+ if (!req->buf) {
+ kfree(req);
return -ENOMEM;
+ }
tipc_disc_init_msg(req->buf, DSC_REQ_MSG, b_ptr);
memcpy(&req->dest, dest, sizeof(*dest));