mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 22:45:17 +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;
|
virStorageNetProtocolTypeToString;
|
||||||
virStorageSourceAuthClear;
|
virStorageSourceAuthClear;
|
||||||
virStorageSourceClear;
|
virStorageSourceClear;
|
||||||
|
virStorageSourceFree;
|
||||||
virStorageSourceGetActualType;
|
virStorageSourceGetActualType;
|
||||||
virStorageSourcePoolDefFree;
|
virStorageSourcePoolDefFree;
|
||||||
virStorageSourcePoolModeTypeFromString;
|
virStorageSourcePoolModeTypeFromString;
|
||||||
|
@ -1719,3 +1719,14 @@ virStorageSourceClear(virStorageSourcePtr def)
|
|||||||
virStorageNetHostDefFree(def->nhosts, def->hosts);
|
virStorageNetHostDefFree(def->nhosts, def->hosts);
|
||||||
virStorageSourceAuthClear(def);
|
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 virStorageSourcePoolDefFree(virStorageSourcePoolDefPtr def);
|
||||||
void virStorageSourceClear(virStorageSourcePtr def);
|
void virStorageSourceClear(virStorageSourcePtr def);
|
||||||
int virStorageSourceGetActualType(virStorageSourcePtr def);
|
int virStorageSourceGetActualType(virStorageSourcePtr def);
|
||||||
|
void virStorageSourceFree(virStorageSourcePtr def);
|
||||||
|
|
||||||
#endif /* __VIR_STORAGE_FILE_H__ */
|
#endif /* __VIR_STORAGE_FILE_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user