mirror of
https://github.com/openwrt/openwrt.git
synced 2024-11-28 04:14:36 +08:00
wprobe: fix missing return code check
SVN-Revision: 19483
This commit is contained in:
parent
50d6e449b3
commit
373b78cb28
@ -560,7 +560,9 @@ wprobe_msg_to_network(int socket, struct nl_msg *msg)
|
|||||||
mhdr.status = WPROBE_MSG_DATA;
|
mhdr.status = WPROBE_MSG_DATA;
|
||||||
mhdr.len = buflen;
|
mhdr.len = buflen;
|
||||||
wprobe_swap_msg_hdr(&mhdr);
|
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);
|
memcpy(buf, nlh, buflen);
|
||||||
nlh = buf;
|
nlh = buf;
|
||||||
@ -572,6 +574,8 @@ wprobe_msg_to_network(int socket, struct nl_msg *msg)
|
|||||||
swap_genlmsghdr(gnlh);
|
swap_genlmsghdr(gnlh);
|
||||||
swap_nlmsghdr(nlh);
|
swap_nlmsghdr(nlh);
|
||||||
ret = write(socket, buf, buflen);
|
ret = write(socket, buf, buflen);
|
||||||
|
|
||||||
|
out:
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user