When virStorageFileGetMetadata is called with NULL path argument, the
invalid pointer boils down through the recursive worker and is caught by
virHashAddEntry which is thankfully resistant to NULL arguments. As it
doesn't make sense to pursue backing chains of NULL volumes, exit
earlier.
This was noticed in the virt-aahelper-test with a slightly modified
codebase.
virHashTablePtr cycle = virHashCreate(5, NULL);
virStorageFileMetadataPtr ret;
- if (!cycle)
+ if (!cycle || !path)
return NULL;
if (format <= VIR_STORAGE_FILE_NONE)