summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-09-04 14:04:15 +0000
committerpixel <pixel>2007-09-04 14:04:15 +0000
commite7deb9b5b2d68756e854ea9026bbb16cadb8c0c8 (patch)
tree001f82df013aeecf0771971fba752eec5c1f6a19
parent24fe8e6bd7c217865863b39e25358473af7e4814 (diff)
Fixing memory usage with GMPString
-rw-r--r--lib/GMPString.cc5
1 files 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 <gmpxx.h>
#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