[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Memory leak in aodv.cc (plus fix)



Hi,

I found a memory leak in aodv.cc. It is in the function AODV::sendRequest().
If you look at this function, you can see that a packet is allocated on
entry to this function. However, there are a couple of conditions on
which the function will terminate without doing anything with this packet.
If this happens, the packet is reserved, but the pointer to the packet is
lost resulting in a memory leak. The memory leak can be avoided by moving 
the initialisation of the rt variable and the two if statements to the 
start of the function.

I can't easily include code or diffs because my linux box is not networking.

Sean.