Merge pull request #13895 from jsynacek/master

sd-dhcp: fix resource leak
This commit is contained in:
Anita Zhang 2019-10-31 11:39:08 -07:00 committed by GitHub
commit 3ec56e53a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

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;