Commit fd995ae6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fixes catastrophic memleak noticed by dionoea and jix

parent be5596d3
......@@ -208,7 +208,9 @@ void Message::AddProgram(Program *p)
void Message::CreateFinalMessage(void)
{
unsigned int i;
/* Deletes previous message */
if(msg != NULL)
free(msg);
/* Check the length */
msg_len = sdp.size() + header_len;
......@@ -222,6 +224,8 @@ void Message::CreateFinalMessage(void)
msg=(char*)malloc(msg_len*sizeof(char));
unsigned int i;
for(i=0; i<header_len; i++)
{
msg[i]=sap[i];
......
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