From 17dca257b7201c315fde4640a71085c2fee21078 Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Tue, 30 Mar 1999 01:23:24 +0000 Subject: [PATCH] Use delete[] for strings allocated with ToNewCString(). --- base/src/nsString2.cpp | 2 +- string/obsolete/nsString2.cpp | 2 +- xpcom/ds/nsString2.cpp | 2 +- xpcom/string/obsolete/nsString2.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/src/nsString2.cpp b/base/src/nsString2.cpp index 6feb0cb413e..580bfebb9b1 100644 --- a/base/src/nsString2.cpp +++ b/base/src/nsString2.cpp @@ -1676,7 +1676,7 @@ NS_BASE int fputs(const nsString2& aString, FILE* out) if(len>0) ::fwrite(cp, 1, len, out); if (cp != buf) { - delete cp; + delete[] cp; } return (int) len; } diff --git a/string/obsolete/nsString2.cpp b/string/obsolete/nsString2.cpp index 6feb0cb413e..580bfebb9b1 100644 --- a/string/obsolete/nsString2.cpp +++ b/string/obsolete/nsString2.cpp @@ -1676,7 +1676,7 @@ NS_BASE int fputs(const nsString2& aString, FILE* out) if(len>0) ::fwrite(cp, 1, len, out); if (cp != buf) { - delete cp; + delete[] cp; } return (int) len; } diff --git a/xpcom/ds/nsString2.cpp b/xpcom/ds/nsString2.cpp index 6feb0cb413e..580bfebb9b1 100644 --- a/xpcom/ds/nsString2.cpp +++ b/xpcom/ds/nsString2.cpp @@ -1676,7 +1676,7 @@ NS_BASE int fputs(const nsString2& aString, FILE* out) if(len>0) ::fwrite(cp, 1, len, out); if (cp != buf) { - delete cp; + delete[] cp; } return (int) len; } diff --git a/xpcom/string/obsolete/nsString2.cpp b/xpcom/string/obsolete/nsString2.cpp index 6feb0cb413e..580bfebb9b1 100644 --- a/xpcom/string/obsolete/nsString2.cpp +++ b/xpcom/string/obsolete/nsString2.cpp @@ -1676,7 +1676,7 @@ NS_BASE int fputs(const nsString2& aString, FILE* out) if(len>0) ::fwrite(cp, 1, len, out); if (cp != buf) { - delete cp; + delete[] cp; } return (int) len; }