Now that no one uses VIR_AUTOSTRINGLIST it can be dropped. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/libvirt_private.syms | 1 - src/util/virstring.c | 10 ---------- src/util/virstring.h | 9 --------- 3 files changed, 20 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 179dcecb0a..2f640ef1c4 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3227,7 +3227,6 @@ virStringHasSuffix; virStringIsEmpty; virStringIsPrintable; virStringListAdd; -virStringListAutoFree; virStringListFreeCount; virStringListGetFirstWithPrefix; virStringListHasString; diff --git a/src/util/virstring.c b/src/util/virstring.c index 5c49b56f75..5578a5545b 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -259,16 +259,6 @@ virStringListMerge(char ***dst, } -void virStringListAutoFree(char ***strings) -{ - if (!*strings) - return; - - g_strfreev(*strings); - *strings = NULL; -} - - /** * virStringListFreeCount: * @strings: array of strings to free diff --git a/src/util/virstring.h b/src/util/virstring.h index 561ce0cbc0..210e43a953 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -45,7 +45,6 @@ void virStringListRemove(char ***strings, int virStringListMerge(char ***dst, char ***src); -void virStringListAutoFree(char ***strings); void virStringListFreeCount(char **strings, size_t count); @@ -179,11 +178,3 @@ int virStringParsePort(const char *str, int virStringParseYesNo(const char *str, bool *result) G_GNUC_WARN_UNUSED_RESULT; -/** - * VIR_AUTOSTRINGLIST: - * - * Declares a NULL-terminated list of strings which will be automatically freed - * when the pointer goes out of scope. - */ -#define VIR_AUTOSTRINGLIST \ - __attribute__((cleanup(virStringListAutoFree))) char ** -- 2.26.2