[Openvas-commits] r7909 - in trunk/openvas-libraries: . base
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jun 3 11:35:51 CEST 2010
Author: felix
Date: 2010-06-03 11:35:50 +0200 (Thu, 03 Jun 2010)
New Revision: 7909
Modified:
trunk/openvas-libraries/ChangeLog
trunk/openvas-libraries/base/openvas_string.c
Log:
* base/openvas_string.c (openvas_string_flatten_string_list): Donate
own memory to returned variable.
Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog 2010-06-03 08:55:07 UTC (rev 7908)
+++ trunk/openvas-libraries/ChangeLog 2010-06-03 09:35:50 UTC (rev 7909)
@@ -1,5 +1,10 @@
2010-06-03 Felix Wolfsteller <felix.wolfsteller at greenbone.net>
+ * base/openvas_string.c (openvas_string_flatten_string_list): Donate
+ own memory to returned variable.
+
+2010-06-03 Felix Wolfsteller <felix.wolfsteller at greenbone.net>
+
* base/openvas_string.c (openvas_string_flatten_string_list): New
utility function.
Modified: trunk/openvas-libraries/base/openvas_string.c
===================================================================
--- trunk/openvas-libraries/base/openvas_string.c 2010-06-03 08:55:07 UTC (rev 7908)
+++ trunk/openvas-libraries/base/openvas_string.c 2010-06-03 09:35:50 UTC (rev 7909)
@@ -240,14 +240,14 @@
* in \ref string_list.
*
* @return Concatenation of strings in \ref string_list, empty string if list
- * is empty.
+ * is empty. Caller has to free with g_free.
*/
gchar*
openvas_string_flatten_string_list (GSList* string_list, const gchar* separator)
{
/* This is an inefficient solution. Improvements can be done by
* precalculating the length, or use GString or the like. */
- gchar* result = "";
+ gchar* result = g_strdup ("");
GSList* it = string_list;
while (it)
{
More information about the Openvas-commits
mailing list