From 5810502d19314924a64539f6fee5c3e4e97c8247 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 10 Dec 2015 16:04:47 +0100 Subject: [PATCH] platform: fix memleak in _nl_sock_flush_data() Fixes: 9a16ce08765faf76e29300090661a5c8e979f6bb (cherry picked from commit eeb7d20ee0f55f38beb40c099b0fd727e3ff9087) --- src/platform/nm-linux-platform.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 9b55d39fb8..de873b9984 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -416,8 +416,11 @@ _nl_sock_flush_data (struct nl_sock *sk) { int nle; struct nl_cb *cb; + struct nl_cb *cb0; - cb = nl_cb_clone (nl_socket_get_cb (sk)); + cb0 = nl_socket_get_cb (sk); + cb = nl_cb_clone (cb0); + nl_cb_put (cb0); if (cb == NULL) return -NLE_NOMEM;