summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-17 01:46:45 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-17 02:01:48 +0200
commite86437cae41717aa27bf14a41f08d9e374b95433 (patch)
tree0a1c228e8f43b638bb166fa45bea4ce11f123652 /src
parent200f56e995563c4af6fcd083b9dd4cab15632440 (diff)
luop: fix mem leak upon error in lu_op_alloc_conn()
Free allocated luop if osmo_gsup_conn_ccm_get() fails. Change-Id: I3ebd5fb5e313be452de893248dd58b2bb73ba94a
Diffstat (limited to 'src')
-rw-r--r--src/luop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/luop.c b/src/luop.c
index 3bedbaa..ef416ac 100644
--- a/src/luop.c
+++ b/src/luop.c
@@ -127,8 +127,10 @@ struct lu_operation *lu_op_alloc_conn(struct osmo_gsup_conn *conn)
uint8_t *peer_addr;
struct lu_operation *luop = lu_op_alloc(conn->server);
int rc = osmo_gsup_conn_ccm_get(conn, &peer_addr, IPAC_IDTAG_SERNR);
- if (rc < 0)
+ if (rc < 0) {
+ lu_op_free(luop);
return NULL;
+ }
luop->peer = talloc_memdup(luop, peer_addr, rc);