mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
util: storagefile: Add function to free a virStorageSourcePtr
Add a free function as some parts of the code will allocate the structure.
This commit is contained in:
parent
39c5aa4e4c
commit
0bd54a10bd
@ -1842,6 +1842,7 @@ virStorageNetHostTransportTypeToString;
|
||||
virStorageNetProtocolTypeToString;
|
||||
virStorageSourceAuthClear;
|
||||
virStorageSourceClear;
|
||||
virStorageSourceFree;
|
||||
virStorageSourceGetActualType;
|
||||
virStorageSourcePoolDefFree;
|
||||
virStorageSourcePoolModeTypeFromString;
|
||||
|
@ -1719,3 +1719,14 @@ virStorageSourceClear(virStorageSourcePtr def)
|
||||
virStorageNetHostDefFree(def->nhosts, def->hosts);
|
||||
virStorageSourceAuthClear(def);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virStorageSourceFree(virStorageSourcePtr def)
|
||||
{
|
||||
if (!def)
|
||||
return;
|
||||
|
||||
virStorageSourceClear(def);
|
||||
VIR_FREE(def);
|
||||
}
|
||||
|
@ -333,5 +333,6 @@ void virStorageSourceAuthClear(virStorageSourcePtr def);
|
||||
void virStorageSourcePoolDefFree(virStorageSourcePoolDefPtr def);
|
||||
void virStorageSourceClear(virStorageSourcePtr def);
|
||||
int virStorageSourceGetActualType(virStorageSourcePtr def);
|
||||
void virStorageSourceFree(virStorageSourcePtr def);
|
||||
|
||||
#endif /* __VIR_STORAGE_FILE_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user