1From fca338b9f453295037f96e8fe9236ebb4763dd25 Mon Sep 17 00:00:00 2001 2From: Thomas Haller <thaller@redhat.com> 3Date: Wed, 15 Apr 2020 13:17:40 +0200 4Subject: [PATCH] rtnl/route: fix NLE_NOMEM handling in parse_multipath() 5 6Conflict:NA 7Reference:https://github.com/thom311/libnl/commit/fca338b9f453295037f96e8fe9236ebb4763dd25 8 9--- 10 lib/route/route_obj.c | 8 ++++++-- 11 1 file changed, 6 insertions(+), 2 deletions(-) 12 13diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c 14index b5cc4ed4..de56a76b 100644 15--- a/lib/route/route_obj.c 16+++ b/lib/route/route_obj.c 17@@ -1072,8 +1072,10 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr) 18 19 addr = nl_addr_alloc_attr(ntb[RTA_NEWDST], 20 route->rt_family); 21- if (!addr) 22+ if (!addr) { 23+ err = -NLE_NOMEM; 24 goto errout; 25+ } 26 27 err = rtnl_route_nh_set_newdst(nh, addr); 28 nl_addr_put(addr); 29@@ -1085,8 +1087,10 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr) 30 struct nl_addr *addr; 31 32 addr = rtnl_route_parse_via(ntb[RTA_VIA]); 33- if (!addr) 34+ if (!addr) { 35+ err = -NLE_NOMEM; 36 goto errout; 37+ } 38 39 err = rtnl_route_nh_set_via(nh, addr); 40 nl_addr_put(addr); 41