aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/hnbgw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hnbgw.c b/src/hnbgw.c
index 9cd977f..143c043 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -138,15 +138,16 @@ static int hnb_read_cb(struct osmo_fd *fd)
/* FIXME: clean up after disappeared HNB */
close(fd->fd);
osmo_fd_unregister(fd);
- return rc;
+ goto out;
} else if (rc == 0) {
LOGP(DMAIN, LOGL_ERROR, "Connection to HNB closed\n");
/* TODO: Remove all UEs from that connection */
close(fd->fd);
osmo_fd_unregister(fd);
fd->fd = -1;
+ rc = -1;
- return -1;
+ goto out;
} else {
msgb_put(msg, rc);
}
@@ -182,6 +183,7 @@ static int hnb_read_cb(struct osmo_fd *fd)
break;
}
+out:
msgb_free(msg);
return rc;
}