Skip to content
Commit 0de4b954 authored by Jesper Juhl's avatar Jesper Juhl Committed by Jiri Kosina
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 5ffd27fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment