diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-15 16:51:43 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-17 19:34:27 +0100 |
commit | 1927e638e18ff03a77a9e227c12f7050559a93c5 (patch) | |
tree | ee2ea6888ff218b2fec98219caf245848650c320 /src | |
parent | b187049925311041fb9d6bacd8960d02759c473c (diff) |
m2ua: Close a huge memory leak in the m2ua code.
Diffstat (limited to 'src')
-rw-r--r-- | src/sctp_m2ua.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sctp_m2ua.c b/src/sctp_m2ua.c index 83784ec..2bafdab 100644 --- a/src/sctp_m2ua.c +++ b/src/sctp_m2ua.c @@ -454,7 +454,7 @@ static int sctp_m2ua_write(struct mtp_link *link, struct msgb *msg) trans = (struct mtp_m2ua_link *) link; if (llist_empty(&trans->conns)) - return -1; + goto clean; llist_for_each_entry(tmp, &trans->conns, entry) if (tmp->established && tmp->asp_active && tmp->asp_up) { @@ -464,12 +464,12 @@ static int sctp_m2ua_write(struct mtp_link *link, struct msgb *msg) if (!conn) { LOGP(DINP, LOGL_ERROR, "No active ASP?\n"); - return -1; + goto clean; } m2ua = m2ua_msg_alloc(); if (!m2ua) - return -1; + goto clean; mtp_handle_pcap(link, NET_OUT, msg->data, msg->len); @@ -487,6 +487,9 @@ static int sctp_m2ua_write(struct mtp_link *link, struct msgb *msg) m2ua_conn_send(conn, m2ua, &info); m2ua_msg_free(m2ua); + +clean: + msgb_free(msg); return 0; } |