Fix CID 1406578: Resource leaks (RESOURCE_LEAK)

** CID 1406578:  Resource leaks  (RESOURCE_LEAK)
/src/libsystemd-network/sd-dhcp-server.c: 155 in sd_dhcp_raw_option_new()
This commit is contained in:
Susant Sahani 2019-10-31 14:25:16 +01:00 committed by Lennart Poettering
parent 3ec56e53a2
commit c0619079cc
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ static sd_dhcp_raw_option* raw_option_free(sd_dhcp_raw_option *i) {
}
_public_ int sd_dhcp_raw_option_new(uint8_t type, char *data, size_t length, sd_dhcp_raw_option **ret) {
sd_dhcp_raw_option *p;
_cleanup_(sd_dhcp_raw_option_unrefp) sd_dhcp_raw_option *p = NULL;
assert_return(ret, -EINVAL);
@ -156,7 +156,7 @@ _public_ int sd_dhcp_raw_option_new(uint8_t type, char *data, size_t length, sd_
return -ENOMEM;
}
*ret = p;
*ret = TAKE_PTR(p);
return 0;
}