diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2015-12-22 16:26:48 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2015-12-22 16:40:46 +0100 |
commit | 269b8ac7ee49b84bda9ab3d57a37689c08e2fab9 (patch) | |
tree | bcd73144aa4842c44df7e3c7813b9800cb6487d2 /src | |
parent | 541e429a39c5bf7120471e85f56c69e2f162b098 (diff) |
hnbgw: Free msgb when connection is closed
Diffstat (limited to 'src')
-rw-r--r-- | src/hnbgw.c | 6 |
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; } |