diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-02-01 00:35:00 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-02-01 00:35:00 +0000 |
commit | 204fa6c4e3bd3ffebb991930909bb078e4f43a31 (patch) | |
tree | 9af2d293682b09e8e5d8551369ddb9259ca3afd1 /package/wprobe | |
parent | 44fa2fdd9662bd2fadbdf26cb5497495e6e0d743 (diff) | |
download | upstream-204fa6c4e3bd3ffebb991930909bb078e4f43a31.tar.gz upstream-204fa6c4e3bd3ffebb991930909bb078e4f43a31.tar.bz2 upstream-204fa6c4e3bd3ffebb991930909bb078e4f43a31.zip |
wprobe: fix missing return code check
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19483 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/wprobe')
-rw-r--r-- | package/wprobe/src/user/wprobe-lib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/package/wprobe/src/user/wprobe-lib.c b/package/wprobe/src/user/wprobe-lib.c index 7ba67cfcb2..7a5460bb00 100644 --- a/package/wprobe/src/user/wprobe-lib.c +++ b/package/wprobe/src/user/wprobe-lib.c @@ -560,7 +560,9 @@ wprobe_msg_to_network(int socket, struct nl_msg *msg) mhdr.status = WPROBE_MSG_DATA; mhdr.len = buflen; wprobe_swap_msg_hdr(&mhdr); - write(socket, &mhdr, sizeof(mhdr)); + ret = write(socket, &mhdr, sizeof(mhdr)); + if (ret < 0) + goto out; memcpy(buf, nlh, buflen); nlh = buf; @@ -572,6 +574,8 @@ wprobe_msg_to_network(int socket, struct nl_msg *msg) swap_genlmsghdr(gnlh); swap_nlmsghdr(nlh); ret = write(socket, buf, buflen); + +out: free(buf); return ret; |