sd-dhcp: fix resource leak

CID#1406578
This commit is contained in:
Jan Synacek 2019-10-31 14:37:43 +01:00
parent 673d873a42
commit 7050e89ee0

View file

@ -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;