chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-dhcp6-client: fix free before use
[elogind.git]
/
src
/
libsystemd-network
/
sd-ipv4ll.c
diff --git
a/src/libsystemd-network/sd-ipv4ll.c
b/src/libsystemd-network/sd-ipv4ll.c
index 72289b2bafd492d6b2089430a9be84a40be46d77..fd39c12eb22df0c028fc1721001627e9a67ea697 100644
(file)
--- a/
src/libsystemd-network/sd-ipv4ll.c
+++ b/
src/libsystemd-network/sd-ipv4ll.c
@@
-382,7
+382,7
@@
static int ipv4ll_receive_message(sd_event_source *s, int fd,
int sd_ipv4ll_set_index(sd_ipv4ll *ll, int interface_index) {
assert_return(ll, -EINVAL);
int sd_ipv4ll_set_index(sd_ipv4ll *ll, int interface_index) {
assert_return(ll, -EINVAL);
- assert_return(interface_index >
= -1
, -EINVAL);
+ assert_return(interface_index >
0
, -EINVAL);
assert_return(IN_SET(ll->state, IPV4LL_STATE_INIT,
IPV4LL_STATE_STOPPED), -EBUSY);
assert_return(IN_SET(ll->state, IPV4LL_STATE_INIT,
IPV4LL_STATE_STOPPED), -EBUSY);
@@
-469,10
+469,13
@@
int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address){
}
int sd_ipv4ll_set_address_seed (sd_ipv4ll *ll, uint8_t seed[8]) {
}
int sd_ipv4ll_set_address_seed (sd_ipv4ll *ll, uint8_t seed[8]) {
- unsigned int entropy
= *seed
;
+ unsigned int entropy;
int r;
assert_return(ll, -EINVAL);
int r;
assert_return(ll, -EINVAL);
+ assert_return(seed, -EINVAL);
+
+ entropy = *seed;
free(ll->random_data);
free(ll->random_data_state);
free(ll->random_data);
free(ll->random_data_state);