Jeff-Lewis / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

Bug when creating MdlAddress, with memory leaks #196

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/dokan/source/browse/trunk/sys/dokan.c?r=171#551

erroneously declared a local variable

PMDL mdl = IoAllocateMdl(Irp->UserBuffer, Length, FALSE, FALSE, Irp);
if (mdl == NULL) {
  DDbgPrint("    IoAllocateMdl returned NULL\n");
  return STATUS_INSUFFICIENT_RESOURCES;
}

and forget about it

I think need to be replaced like this

Irp->MdlAddress = IoAllocateMdl(Irp->UserBuffer, Length, FALSE, FALSE, Irp);
if (Irp->MdlAddress == NULL) {
  DDbgPrint("    IoAllocateMdl returned NULL\n");
  return STATUS_INSUFFICIENT_RESOURCES;
}

Original issue reported on code.google.com by xxxel...@gmail.com on 7 Jan 2011 at 7:13

GoogleCodeExporter commented 9 years ago
Opps, bad mistake. Thank you for pointing this out.
Fixed by http://code.google.com/p/dokan/source/detail?r=172

Original comment by asa...@gmail.com on 8 Jan 2011 at 2:19