Commit 611860e8 authored by Jon Grimm's avatar Jon Grimm Committed by Jon Grimm

[SCTP] Free up data chunks that don't get accepted by primitive_SEND.

Fix memory leak.  
parent beca2c15
......@@ -1100,12 +1100,18 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
chunk->transport = chunk_tp;
/* Send it to the lower layers. */
sctp_primitive_SEND(asoc, chunk);
err = sctp_primitive_SEND(asoc, chunk);
/* Did the lower layer accept the chunk? */
if (err)
sctp_chunk_free(chunk);
SCTP_DEBUG_PRINTK("We sent primitively.\n");
}
sctp_datamsg_free(datamsg);
err = msg_len;
if (err)
goto out_free;
else
err = msg_len;
/* If we are already past ASSOCIATE, the lower
* layers are responsible for association cleanup.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment