commit | 3bfa73ff99291d872f6d0e0284ee416e880088b6 | [log] [tgz] |
---|---|---|
author | Stephen Hemminger <shemminger@osdl.org> | Tue Sep 26 10:41:57 2006 -0700 |
committer | Stephen Hemminger <shemminger@osdl.org> | Tue Sep 26 10:41:57 2006 -0700 |
tree | 3127ada087e747b2bf148b5fb07dd94a20f83b35 | |
parent | 77219712bf5bbb1a65961c9b322e4a68c55276ab [diff] [blame] |
rtnl fd check Prevent accidental damage from rtnl library if fd is uninitialized. Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 67951fe..5c6a4dc 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c
@@ -27,7 +27,10 @@ void rtnl_close(struct rtnl_handle *rth) { - close(rth->fd); + if (rth->fd >= 0) { + close(rth->fd); + rth->fd = -1; + } } int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions,