]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commitdiff
Fix memory leak in error path
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 28 Jan 2016 14:40:49 +0000 (14:40 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 28 Jan 2016 14:43:08 +0000 (14:43 +0000)
If a malformed large packet is received then it is possible that a packet
structure is leaked on the error path.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvif/receiver.c

index 33904738ddeb7276c18bd089eb6b02559f490840..9b4c3b391d1440ff533ee754f1c30d3a43ebe42f 100644 (file)
@@ -1297,9 +1297,10 @@ ReceiverRingProcessPacket(
 
 fail3:
     Packet->Mdl.Next = NULL;
-    __ReceiverRingPutPacket(Ring, Packet, TRUE);
 
 fail2:
+    __ReceiverRingPutPacket(Ring, Packet, TRUE);
+
 fail1:
     if (Payload.Length != 0) {
         PMDL    Mdl = Payload.Mdl;