Skip to content

Commit 8003fe0

Browse files
committed
util: recommend g_strfreev instead of virStringListFree
Signed-off-by: Ján Tomko <[email protected]> Reviewed-by: Martin Kletzander <[email protected]>
1 parent ee247e1 commit 8003fe0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/util/virfile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath G_GNUC_UNUSED,
20392039
* the path @prefix, sorted alphabetically.
20402040
*
20412041
* The @mountsret array will be NULL terminated and should
2042-
* be freed with virStringListFree
2042+
* be freed with g_strfreev
20432043
*
20442044
* Returns 0 on success, -1 on error
20452045
*/
@@ -2062,7 +2062,7 @@ int virFileGetMountSubtree(const char *mtabpath,
20622062
* the path @prefix, reverse-sorted alphabetically.
20632063
*
20642064
* The @mountsret array will be NULL terminated and should
2065-
* be freed with virStringListFree
2065+
* be freed with g_strfreev
20662066
*
20672067
* Returns 0 on success, -1 on error
20682068
*/

src/util/virstring.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ VIR_LOG_INIT("util.string");
6464
* before calling virStringSplit().
6565
*
6666
* Return value: a newly-allocated NULL-terminated array of strings. Use
67-
* virStringListFree() to free it.
67+
* g_strfreev() to free it.
6868
*/
6969
char **
7070
virStringSplitCount(const char *string,
@@ -252,7 +252,7 @@ virStringListMerge(char ***dst,
252252
for (i = 0; i <= src_len; i++)
253253
(*dst)[i + dst_len] = (*src)[i];
254254

255-
/* Don't call virStringListFree() as it would free strings in
255+
/* Don't call g_strfreev() as it would free strings in
256256
* @src. */
257257
VIR_FREE(*src);
258258
return 0;
@@ -900,7 +900,7 @@ int virStringSortRevCompare(const void *a, const void *b)
900900
* @matches: pointer to an array to be filled with NULL terminated list of matches
901901
*
902902
* Performs a POSIX extended regex search against a string and return all matching substrings.
903-
* The @matches value should be freed with virStringListFree() when no longer
903+
* The @matches value should be freed with g_strfreev() when no longer
904904
* required.
905905
*
906906
* @code
@@ -920,7 +920,7 @@ int virStringSortRevCompare(const void *a, const void *b)
920920
* // matches[2] == "bbb3c75c-d60f-43b0-b802-fd56b84a4222"
921921
* // matches[3] == NULL;
922922
*
923-
* virStringListFree(matches);
923+
* g_strfreev(matches);
924924
* @endcode
925925
*
926926
* Returns: -1 on error, or number of matches

tools/vsh.c

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

0 commit comments

Comments
 (0)