mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
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:
parent
ee247e1d3f
commit
8003fe0361
@ -2039,7 +2039,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath G_GNUC_UNUSED,
|
|||||||
* the path @prefix, sorted alphabetically.
|
* the path @prefix, sorted alphabetically.
|
||||||
*
|
*
|
||||||
* The @mountsret array will be NULL terminated and should
|
* 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
|
* Returns 0 on success, -1 on error
|
||||||
*/
|
*/
|
||||||
@ -2062,7 +2062,7 @@ int virFileGetMountSubtree(const char *mtabpath,
|
|||||||
* the path @prefix, reverse-sorted alphabetically.
|
* the path @prefix, reverse-sorted alphabetically.
|
||||||
*
|
*
|
||||||
* The @mountsret array will be NULL terminated and should
|
* 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
|
* Returns 0 on success, -1 on error
|
||||||
*/
|
*/
|
||||||
|
@ -64,7 +64,7 @@ VIR_LOG_INIT("util.string");
|
|||||||
* before calling virStringSplit().
|
* before calling virStringSplit().
|
||||||
*
|
*
|
||||||
* Return value: a newly-allocated NULL-terminated array of strings. Use
|
* Return value: a newly-allocated NULL-terminated array of strings. Use
|
||||||
* virStringListFree() to free it.
|
* g_strfreev() to free it.
|
||||||
*/
|
*/
|
||||||
char **
|
char **
|
||||||
virStringSplitCount(const char *string,
|
virStringSplitCount(const char *string,
|
||||||
@ -252,7 +252,7 @@ virStringListMerge(char ***dst,
|
|||||||
for (i = 0; i <= src_len; i++)
|
for (i = 0; i <= src_len; i++)
|
||||||
(*dst)[i + dst_len] = (*src)[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. */
|
* @src. */
|
||||||
VIR_FREE(*src);
|
VIR_FREE(*src);
|
||||||
return 0;
|
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
|
* @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.
|
* 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.
|
* required.
|
||||||
*
|
*
|
||||||
* @code
|
* @code
|
||||||
@ -920,7 +920,7 @@ int virStringSortRevCompare(const void *a, const void *b)
|
|||||||
* // matches[2] == "bbb3c75c-d60f-43b0-b802-fd56b84a4222"
|
* // matches[2] == "bbb3c75c-d60f-43b0-b802-fd56b84a4222"
|
||||||
* // matches[3] == NULL;
|
* // matches[3] == NULL;
|
||||||
*
|
*
|
||||||
* virStringListFree(matches);
|
* g_strfreev(matches);
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* Returns: -1 on error, or number of matches
|
* Returns: -1 on error, or number of matches
|
||||||
|
@ -127,7 +127,7 @@ vshNameSorter(const void *a, const void *b)
|
|||||||
/*
|
/*
|
||||||
* Convert the strings separated by ',' into array. The returned
|
* Convert the strings separated by ',' into array. The returned
|
||||||
* array is a NULL terminated string list. The caller has to free
|
* 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
|
* Returns the length of the filled array on success, or -1
|
||||||
* on error.
|
* on error.
|
||||||
|
Loading…
Reference in New Issue
Block a user