stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r436919 - /incubator/stdcxx/trunk/util/runall.cpp
Date Fri, 25 Aug 2006 19:46:53 GMT
Author: sebor
Date: Fri Aug 25 12:46:52 2006
New Revision: 436919

URL: http://svn.apache.org/viewvc?rev=436919&view=rev
Log:
2006-08-25  Andrew Black  <ablack@roguewave.com>

	* runall.cpp (merge_argv): Update function documentation.
	(run_target): Free argv array returned by merge_argv.

Modified:
    incubator/stdcxx/trunk/util/runall.cpp

Modified: incubator/stdcxx/trunk/util/runall.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/runall.cpp?rev=436919&r1=436918&r2=436919&view=diff
==============================================================================
--- incubator/stdcxx/trunk/util/runall.cpp (original)
+++ incubator/stdcxx/trunk/util/runall.cpp Fri Aug 25 12:46:52 2006
@@ -73,6 +73,9 @@
    argument string is '%x' (no quotes), the contents of the provided argv 
    array will be inserted into the return array at that point.
 
+   It is the responsibility of the caller to free() the returned blocks of
+   memory, which were allocated by a call to split_opt_string().
+
    @todo Figure out an escaping mechanism to allow '%x' to be passed to an
    executable
 
@@ -402,7 +405,6 @@
 static void
 run_target (char* target, char** argv)
 {
-    struct exec_attrs status;
     char** childargv;
 
     assert (0 != target);
@@ -418,12 +420,13 @@
     printf ("%-25.25s ", target_name);
     fflush (stdout);
 
-    if (!check_target_ok (childargv [0]))
-        return;
-
-    status = exec_file (childargv);
+    if (check_target_ok (childargv [0])) {
+        struct exec_attrs status = exec_file (childargv);
+        process_results (childargv [0], &status);
+    }
 
-    process_results (childargv [0], &status);
+    free (childargv [0]);
+    free (childargv);
 }
 
 /**



Mime
View raw message