diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-31 21:17:46 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-31 21:17:46 +0200 |
commit | f25c92359e57b1e97c86174067485acf6a9445de (patch) | |
tree | 2087c2144629be0c2de43bcb4177d17ddd2a4609 /src | |
parent | 2a9e807c7822315f7fe7d45d8ed904ab83005c8f (diff) | |
download | fastd-f25c92359e57b1e97c86174067485acf6a9445de.tar fastd-f25c92359e57b1e97c86174067485acf6a9445de.zip |
Handle receive errors correctly
Diffstat (limited to 'src')
-rw-r--r-- | src/fastd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c index 58df7ec..311af08 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -287,8 +287,11 @@ static void handle_socket(fastd_context *ctx, int sockfd) { msg.msg_iovlen = 2; ssize_t len = recvmsg(sockfd, &msg, 0); - if (len < 0) + if (len < 0) { pr_warn(ctx, "recvfrom: %s", strerror(errno)); + fastd_buffer_free(buffer); + return; + } buffer.len = len - 1; |