diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-19 16:51:24 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-19 18:26:32 +0200 |
commit | 0d720639733e9a8b3011ba62af2c48a7a49a3143 (patch) | |
tree | e68ede2c81ecd984297a220d43e513954d802d57 /src/tools/config.c | |
parent | tools: side channel resistant base64 (diff) | |
download | wireguard-monolithic-historical-0d720639733e9a8b3011ba62af2c48a7a49a3143.tar.xz wireguard-monolithic-historical-0d720639733e9a8b3011ba62af2c48a7a49a3143.zip |
tools: check for malloc failure
Diffstat (limited to 'src/tools/config.c')
-rw-r--r-- | src/tools/config.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/config.c b/src/tools/config.c index 8f75804..be15870 100644 --- a/src/tools/config.c +++ b/src/tools/config.c @@ -153,6 +153,10 @@ static inline bool parse_endpoint(struct sockaddr *endpoint, const char *value) .ai_socktype = SOCK_DGRAM, .ai_protocol = IPPROTO_UDP }; + if (!mutable) { + perror("strdup"); + return false; + } if (!strlen(value)) { free(mutable); fprintf(stderr, "Unable to parse empty endpoint\n"); |