
From hans-peter.nilsson@axis.com Wed Jan  6 09:04:00 1999
Date: Wed, 6 Jan 1999 14:57:01 +0100
From: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
To: htdig@sdsu.edu
Subject: htdig: Patch for String.cc: Missing [] for delete

The CVS tree is unstable right now.  Here's *one* patch, more needed.
(Note to the curious: everything allocated with "new []" *must*
be deleted with "delete []", regardless if it's just a "new char [1]".)

Wed Jan  6 14:52:11 1999  Hans-Peter Nilsson  <hp@axis.se>

	* htlib/String.cc (allocate_space): Add missing [] to delete.


Index: String.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htlib/String.cc,v
retrieving revision 1.11
diff -p -c -r1.11 String.cc
*** String.cc	1998/12/19 14:39:41	1.11
--- String.cc	1999/01/06 13:51:05
*************** void String::allocate_space(int len)
*** 569,575 ****
      if (Data)
      {
  	if (len > Allocated)
! 	    delete Data;
  	else
  	    return;		// No need to allocate space.
      }
--- 569,575 ----
      if (Data)
      {
  	if (len > Allocated)
! 	    delete [] Data;
  	else
  	    return;		// No need to allocate space.
      }

brgds, H-P
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.
