sd-dhcp: fix resource leak
CID#1406578
This commit is contained in:
parent
673d873a42
commit
7050e89ee0
|
@ -151,8 +151,10 @@ _public_ int sd_dhcp_raw_option_new(uint8_t type, char *data, size_t length, sd_
|
|||
.type = type,
|
||||
};
|
||||
|
||||
if (!p->data)
|
||||
if (!p->data) {
|
||||
free(p);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
*ret = p;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue