From e7deb9b5b2d68756e854ea9026bbb16cadb8c0c8 Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 4 Sep 2007 14:04:15 +0000 Subject: Fixing memory usage with GMPString --- lib/GMPString.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/GMPString.cc b/lib/GMPString.cc index 83c6d85..9e34d2e 100644 --- a/lib/GMPString.cc +++ b/lib/GMPString.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: GMPString.cc,v 1.7 2007-05-30 11:57:09 pixel Exp $ */ +/* $Id: GMPString.cc,v 1.8 2007-09-04 14:04:15 pixel Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -26,7 +26,7 @@ #include #include "GMPString.h" -GMPString::GMPString(const GMPString & s) : str(s.str) { +GMPString::GMPString(const GMPString & s) : str(strdup(s.str)) { } GMPString::GMPString(const mpz_class & z) { @@ -46,6 +46,7 @@ GMPString::operator String() const { } GMPString::~GMPString() { + free(str); } #endif -- cgit v1.2.3