summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-31 21:17:46 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-31 21:17:46 +0200
commitf25c92359e57b1e97c86174067485acf6a9445de (patch)
tree2087c2144629be0c2de43bcb4177d17ddd2a4609 /src/fastd.c
parent2a9e807c7822315f7fe7d45d8ed904ab83005c8f (diff)
downloadfastd-f25c92359e57b1e97c86174067485acf6a9445de.tar
fastd-f25c92359e57b1e97c86174067485acf6a9445de.zip
Handle receive errors correctly
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c5
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;