Fix mismatched new/delete calls.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 16 Oct 2007 20:47:34 +0000 (13:47 -0700)
committerMichael Vrable <mvrable@beleg.vrable.net>
Tue, 16 Oct 2007 20:47:34 +0000 (13:47 -0700)
Caught by Valgrind: memory was being allocated with new[] but freed with
delete.  Use delete[] instead.

util.cc

diff --git a/util.cc b/util.cc
index 13ad991..a51fa3d 100644 (file)
--- a/util.cc
+++ b/util.cc
@@ -67,7 +67,7 @@ string uri_decode(const string &in)
     *output = '\0';
 
     string result(buf);
-    delete buf;
+    delete[] buf;
     return result;
 }