mirror of https://gitee.com/openkylin/libvirt.git
util: socketaddr: Introduce virSocketAddrFree helper
This will not only help us in the future when adding more and more VIR_AUTOPTR instances, we're also consistent in that a compound type gets its own function which can easily be extended in the future if necessary. Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com> Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
7b706f33ac
commit
d090c814ab
|
@ -1253,3 +1253,9 @@ virSocketAddrPTRDomain(const virSocketAddr *addr,
|
|||
ret = -2;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
void
|
||||
virSocketAddrFree(virSocketAddrPtr addr)
|
||||
{
|
||||
VIR_FREE(addr);
|
||||
}
|
||||
|
|
|
@ -162,4 +162,6 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr,
|
|||
char **ptr)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
||||
|
||||
void virSocketAddrFree(virSocketAddrPtr addr);
|
||||
|
||||
#endif /* __VIR_SOCKETADDR_H__ */
|
||||
|
|
Loading…
Reference in New Issue