Plug leaks

svn path=/trunk/; revision=71335
This commit is contained in:
Pierre Schweitzer 2016-05-15 17:45:10 +00:00
parent dd2544d913
commit a3778e6d22
2 changed files with 4 additions and 0 deletions

View file

@ -56,6 +56,7 @@ int display_dhcp_packet( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
break;
}
fprintf( stdout, "Message Type: %s \n", mtype );
free( mtype );
return 0;
}

View file

@ -209,6 +209,7 @@ int process_dhcp_packet( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
if( find_lease( &dhcpl, dhcpm->xid, dhcpm->chaddr ) < 0 )
{
fprintf( stdout, "No free leases! \n" );
free( name );
return -1;
}
dhcpm->op = BOOTREPLY;
@ -281,6 +282,7 @@ int process_dhcp_packet( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
sprintf( name, "%u.%u.%u.%u", (dhcpm->ciaddr &0xFF), ((dhcpm->ciaddr>>8)&0xFF), ((dhcpm->ciaddr>>16)&0xFF), ((dhcpm->ciaddr>>24)&0xFF));
display_dhcp_packet( dhcpm, dhcpo );
write_packet( dhcpm, name );
free( name );
return -1;
}
dhcpm->siaddr = dhcpl.siaddr;
@ -339,6 +341,7 @@ int process_dhcp_packet( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
display_dhcp_packet( dhcpm, dhcpo );
write_packet( dhcpm, name );
fprintf( stdout, "process_dhcp_packet [end]!\n");
free( name );
return 0;
}