giochannel: avoid setting uninitialised length
[platform/upstream/glib.git] / gio / gsubprocess.c
index 19cbf57..ebdfd43 100644 (file)
@@ -649,8 +649,8 @@ g_subprocess_class_init (GSubprocessClass *class)
  * g_subprocess_new: (skip)
  * @flags: flags that define the behaviour of the subprocess
  * @error: (allow-none): return location for an error, or %NULL
- * @argv0: first commandline argument to pass to the subprocess,
- *     followed by more arguments, followed by %NULL
+ * @argv0: first commandline argument to pass to the subprocess
+ * @...:   more commandline arguments, followed by %NULL
  *
  * Create a new process with the given flags and varargs argument
  * list.  By default, matching the g_spawn_async() defaults, the
@@ -686,6 +686,7 @@ g_subprocess_new (GSubprocessFlags   flags,
   while ((arg = va_arg (ap, const gchar *)))
     g_ptr_array_add (args, (gchar *) arg);
   g_ptr_array_add (args, NULL);
+  va_end (ap);
 
   result = g_subprocess_newv ((const gchar * const *) args->pdata, flags, error);
 
@@ -727,8 +728,8 @@ g_subprocess_newv (const gchar * const  *argv,
  * g_subprocess_get_identifier:
  * @subprocess: a #GSubprocess
  *
- * On UNIX, returns the process ID as a decimal string.  On Windows,
- * returns the result of GetProcessId() also as a string.
+ * On UNIX, returns the process ID as a decimal string.
+ * On Windows, returns the result of GetProcessId() also as a string.
  */
 const gchar *
 g_subprocess_get_identifier (GSubprocess *subprocess)