doc: getdelays.c: remember to close() socket on error in create_nl_socket()
authorJesper Juhl <jj@chaosbits.net>
Wed, 8 Aug 2012 18:56:14 +0000 (20:56 +0200)
committerJiri Kosina <jkosina@suse.cz>
Sat, 1 Sep 2012 16:58:59 +0000 (09:58 -0700)
commit0de4b95409367f5012ff5be7fd3785dc11c6cda8
tree57b97d9ccec8fe8a403f7d3040469d7370b58662
parent5ffd27fa8d7950a3c2136100860273e6ff2605e0
doc: getdelays.c: remember to close() socket on error in create_nl_socket()

If the call to setsockopt() fails in
Documentation/accounting/getdelays.c::create_nl_socket() we return -1
without closing the socket, thus leaking it when the 'fd' variable
goes out of scope.

Easily fixed by just jumping to the 'error' label instead of returning
since we do the proper cleanup there.

While I was there I noticed that the error message that is printet if
setsockopt() fails was broken over two lines - put that on a single
line so it is easier to grep for.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Documentation/accounting/getdelays.c