projects
/
librecmc
/
librecmc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50d6e44
)
wprobe: fix missing return code check
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 1 Feb 2010 00:35:00 +0000
(
00:35
+0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 1 Feb 2010 00:35:00 +0000
(
00:35
+0000)
SVN-Revision: 19483
package/wprobe/src/user/wprobe-lib.c
patch
|
blob
|
history
diff --git
a/package/wprobe/src/user/wprobe-lib.c
b/package/wprobe/src/user/wprobe-lib.c
index 7ba67cfcb24be0d1272b3d7ee4fcfad9ed302971..7a5460bb00bfbc0b1bda673c03bc40ccae78fd76 100644
(file)
--- 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;