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,11 +1100,17 @@ 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);
if (err)
goto out_free;
else
err = msg_len;
/* If we are already past ASSOCIATE, the lower
......
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