X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/e31fe7691afe97ab6c2dce0b2bb12dc54fb80b21..c18e77fd345fcede79e68a58e3d0f99ded084338:/package/wprobe/src/user/wprobe-lib.c diff --git a/package/wprobe/src/user/wprobe-lib.c b/package/wprobe/src/user/wprobe-lib.c index 7ba67cfcb..7a5460bb0 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;