memfs: fix erroneous realloc

This commit is contained in:
Bill Zissimopoulos 2016-05-20 18:17:00 -07:00
parent 4f5e00474e
commit 599430e649

View File

@ -634,7 +634,7 @@ static NTSTATUS SetAllocationSize(FSP_FILE_SYSTEM *FileSystem,
return STATUS_DISK_FULL;
FileData = realloc(FileNode->FileData, (size_t)AllocationSize);
if (0 == FileData)
if (0 == FileData && 0 != AllocationSize)
return STATUS_INSUFFICIENT_RESOURCES;
FileNode->FileData = FileData;