From e3575da7c5d95638fe45f26742612bd16e6b6e29 Mon Sep 17 00:00:00 2001 From: "mcafee%netscape.com" Date: Mon, 14 Jun 1999 22:18:29 +0000 Subject: [PATCH] Fixing Solaris memory problem, patch supplied by bruce@cybersight.com. a=mcmullen (6098) --- profile/src/nsProfile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index aa89ba281a91..e91cc9e882c6 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -15,6 +15,7 @@ * Copyright (C) 1998 Netscape Communications Corporation. All Rights * Reserved. */ + #include "nsIProfile.h" #include "nsIPref.h" @@ -816,6 +817,7 @@ NS_IMETHODIMP nsProfile::SetProfileDir(const char *profileName, const nsFileSpec // Persistency nsPersistentFileDescriptor descriptor(profileDir); char* profileDirString = nsnull; + profileDirString = nsCRT::strdup(profileDir.GetCString()); nsOutputStringStream stream(profileDirString); stream << descriptor; @@ -844,7 +846,7 @@ NS_IMETHODIMP nsProfile::SetProfileDir(const char *profileName, const nsFileSpec printf("NULL value received for directory name.\n" ); #endif } - delete [] profileDirString; + nsCRT::free(profileDirString); } else {