[PATCH v2 25/27] util: alloc: Remove VIR_AUTODISPOSE_STR

Peter Krempa posted 27 patches 5 years ago
[PATCH v2 25/27] util: alloc: Remove VIR_AUTODISPOSE_STR
Posted by Peter Krempa 5 years ago
There are no users any more. The replacement is to use g_auto and
virSecureEraseString explicitly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/viralloc.h | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index 0173107b87..f9387a00f9 100644
--- a/src/util/viralloc.h
+++ b/src/util/viralloc.h
@@ -349,13 +349,3 @@ void virDisposeString(char **strptr)
  * This macro is not safe to be used on arguments with side effects.
  */
 #define VIR_DISPOSE_STRING(ptr) virDisposeString(&(ptr))
-
-/**
- * VIR_AUTODISPOSE_STR:
- *
- * Macro to automatically free and clear the memory allocated to
- * the string variable declared with it by calling virDisposeString
- * when the variable goes out of scope.
- */
-#define VIR_AUTODISPOSE_STR \
-    __attribute__((cleanup(virDisposeString))) char *
-- 
2.29.2

Re: [PATCH v2 25/27] util: alloc: Remove VIR_AUTODISPOSE_STR
Posted by Daniel P. Berrangé 5 years ago
On Tue, Feb 02, 2021 at 05:56:02PM +0100, Peter Krempa wrote:
> There are no users any more. The replacement is to use g_auto and
> virSecureEraseString explicitly.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/util/viralloc.h | 10 ----------
>  1 file changed, 10 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|