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 | 373b78cb28e086abe08d2f6d57f2f441fc5d862f (patch) | |
tree | 46c46999e7f0f1e68314043f5fefc9dc4b6f619c | |
parent | 50d6e449b3a145cdfd1117eb040b4acf58faebe0 (diff) | |
download | mtk-20170518-373b78cb28e086abe08d2f6d57f2f441fc5d862f.zip mtk-20170518-373b78cb28e086abe08d2f6d57f2f441fc5d862f.tar.gz mtk-20170518-373b78cb28e086abe08d2f6d57f2f441fc5d862f.tar.bz2 |
wprobe: fix missing return code check
SVN-Revision: 19483
-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 7ba67cf..7a5460b 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; |