wg: check for malloc failure
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
755217bd85
commit
6a967c63a7
|
@ -153,6 +153,10 @@ static inline bool parse_endpoint(struct sockaddr *endpoint, const char *value)
|
||||||
.ai_socktype = SOCK_DGRAM,
|
.ai_socktype = SOCK_DGRAM,
|
||||||
.ai_protocol = IPPROTO_UDP
|
.ai_protocol = IPPROTO_UDP
|
||||||
};
|
};
|
||||||
|
if (!mutable) {
|
||||||
|
perror("strdup");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!strlen(value)) {
|
if (!strlen(value)) {
|
||||||
free(mutable);
|
free(mutable);
|
||||||
fprintf(stderr, "Unable to parse empty endpoint\n");
|
fprintf(stderr, "Unable to parse empty endpoint\n");
|
||||||
|
|
Loading…
Reference in a new issue