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; }