mirror of
https://github.com/systemd/systemd.git
synced 2025-01-23 02:04:32 +03:00
sd-netlink: add several assertions
This commit is contained in:
parent
2d1ad72456
commit
f6dab7489e
@ -244,7 +244,8 @@ int socket_writev_message(sd_netlink *nl, sd_netlink_message **m, size_t msgcoun
|
||||
size_t i;
|
||||
|
||||
assert(nl);
|
||||
assert(msgcount);
|
||||
assert(m);
|
||||
assert(msgcount > 0);
|
||||
|
||||
iovs = new0(struct iovec, msgcount);
|
||||
if (!iovs)
|
||||
|
@ -237,6 +237,7 @@ int sd_netlink_sendv(sd_netlink *nl,
|
||||
assert_return(nl, -EINVAL);
|
||||
assert_return(!rtnl_pid_changed(nl), -ECHILD);
|
||||
assert_return(messages, -EINVAL);
|
||||
assert_return(msgcount > 0, -EINVAL);
|
||||
|
||||
if (ret_serial) {
|
||||
serials = new0(uint32_t, msgcount);
|
||||
|
Loading…
x
Reference in New Issue
Block a user