# HG changeset patch # User jwe # Date 1153327932 0 # Node ID 8545ec4d6e65eae07e2a3196cb652c269786f76d # Parent fc22530e985b075cfae7a1bfc1502caab41aadcf [project @ 2006-07-19 16:51:50 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-07-19 John W. Eaton + + * ov-base.cc (octave_base_value::numeric_assign): + Avoid memory leak when converting LHS. + 2006-07-18 John W. Eaton * ov.h (octave_value::is_int8_type, octave_value::is_int16_type, diff --git a/src/ov-base.cc b/src/ov-base.cc --- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -972,14 +972,15 @@ octave_base_value::type_conv_fcn cf_this = numeric_conversion_function (); - octave_base_value *tmp_lhs = this; + count++; + octave_value tmp_lhs = octave_value (this); if (cf_this) { octave_base_value *tmp = cf_this (*this); if (tmp) - tmp_lhs = tmp; + tmp_lhs = octave_value (tmp); else { gripe_assign_conversion_failed (type_name (), @@ -990,7 +991,7 @@ if (cf_this || cf_rhs) { - retval = tmp_lhs->subsasgn (type, idx, tmp_rhs); + retval = tmp_lhs.subsasgn (type, idx, tmp_rhs); done = (! error_state); }