changeset 5304:7b6edb02f8c9

[project @ 2005-04-25 16:36:32 by jwe]
author jwe
date Mon, 25 Apr 2005 16:36:32 +0000
parents 9281e7a8072a
children 539428e4606a
files liboctave/ChangeLog liboctave/str-vec.cc
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Fri Apr 22 20:51:31 2005 +0000
+++ b/liboctave/ChangeLog	Mon Apr 25 16:36:32 2005 +0000
@@ -1,3 +1,8 @@
+2005-04-25  John W. Eaton  <jwe@octave.org>
+
+	* str-vec.cc (string_vector::delete_c_str_vec): Correctly free
+	array and its contents.
+
 2005-04-22  John W. Eaton  <jwe@octave.org>
 
 	* oct-rl-edit.c (octave_rl_set_terminal_name): Don't cast away
--- a/liboctave/str-vec.cc	Fri Apr 22 20:51:31 2005 +0000
+++ b/liboctave/str-vec.cc	Mon Apr 25 16:36:32 2005 +0000
@@ -142,8 +142,10 @@
 void
 string_vector::delete_c_str_vec (const char * const *v)
 {
-  while (*v)
-    delete [] *v;
+  const char * const *p = v;
+
+  while (*p)
+    delete [] *p++;
 
   delete [] v;
 }