]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: recommend g_strfreev instead of virStringListFree
authorJán Tomko <jtomko@redhat.com>
Sun, 2 Aug 2020 22:01:11 +0000 (00:01 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 3 Aug 2020 13:37:36 +0000 (15:37 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/util/virfile.c
src/util/virstring.c
tools/vsh.c

index 08c0b9baab106db2282282baec056f208170e5ae..6ada3a708c2824282b45ea27b101cf26a974a976 100644 (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
  */
index a63f92d9a7623a6e5620799717ab7f566e8784a2..b31d4743f2971c732dae1fbe05714e9f52c5a26c 100644 (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
index 6b8cb7fadaf955d7001043291480fdaca9628961..5e2e3ac2190be965cd310274b3739dfabc8b082b 100644 (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.