diff options
author | Susant Sahani <ssahani@vmware.com> | 2019-10-31 14:25:16 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-10-31 21:13:57 +0100 |
commit | c0619079cc9f3c81da24b38f803e7aadb85be953 (patch) | |
tree | 9945cda9a71b1373113bcbb0a32087cdca2b17d3 /src | |
parent | Merge pull request #13895 from jsynacek/master (diff) | |
download | systemd-c0619079cc9f3c81da24b38f803e7aadb85be953.tar.xz systemd-c0619079cc9f3c81da24b38f803e7aadb85be953.zip |
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()
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index f7022dd715..0f000f5055 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -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; } |