util: recommend g_strfreev instead of virStringListFree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2020-08-03 00:01:11 +02:00
parent ee247e1d3f
commit 8003fe0361
3 changed files with 7 additions and 7 deletions

View File

@ -2039,7 +2039,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath G_GNUC_UNUSED,
* the path @prefix, sorted alphabetically.
*
* The @mountsret array will be NULL terminated and should
* be freed with virStringListFree
* be freed with g_strfreev
*
* Returns 0 on success, -1 on error
*/
@ -2062,7 +2062,7 @@ int virFileGetMountSubtree(const char *mtabpath,
* the path @prefix, reverse-sorted alphabetically.
*
* The @mountsret array will be NULL terminated and should
* be freed with virStringListFree
* be freed with g_strfreev
*
* Returns 0 on success, -1 on error
*/

View File

@ -64,7 +64,7 @@ VIR_LOG_INIT("util.string");
* before calling virStringSplit().
*
* Return value: a newly-allocated NULL-terminated array of strings. Use
* virStringListFree() to free it.
* g_strfreev() to free it.
*/
char **
virStringSplitCount(const char *string,
@ -252,7 +252,7 @@ virStringListMerge(char ***dst,
for (i = 0; i <= src_len; i++)
(*dst)[i + dst_len] = (*src)[i];
/* Don't call virStringListFree() as it would free strings in
/* Don't call g_strfreev() as it would free strings in
* @src. */
VIR_FREE(*src);
return 0;
@ -900,7 +900,7 @@ int virStringSortRevCompare(const void *a, const void *b)
* @matches: pointer to an array to be filled with NULL terminated list of matches
*
* Performs a POSIX extended regex search against a string and return all matching substrings.
* The @matches value should be freed with virStringListFree() when no longer
* The @matches value should be freed with g_strfreev() when no longer
* required.
*
* @code
@ -920,7 +920,7 @@ int virStringSortRevCompare(const void *a, const void *b)
* // matches[2] == "bbb3c75c-d60f-43b0-b802-fd56b84a4222"
* // matches[3] == NULL;
*
* virStringListFree(matches);
* g_strfreev(matches);
* @endcode
*
* Returns: -1 on error, or number of matches

View File

@ -127,7 +127,7 @@ vshNameSorter(const void *a, const void *b)
/*
* Convert the strings separated by ',' into array. The returned
* array is a NULL terminated string list. The caller has to free
* the array using virStringListFree or a similar method.
* the array using g_strfreev or a similar method.
*
* Returns the length of the filled array on success, or -1
* on error.