From 79639ae44956518af9d7b0b5d506f8ae53875178 Mon Sep 17 00:00:00 2001 From: Jesse Ruderman Date: Wed, 10 Sep 2008 15:02:06 -0700 Subject: [PATCH] Fix bug 445999, nsCStringArray::operator= leaks all strings that were in the destination array. r=bsmedberg --- xpcom/glue/nsVoidArray.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xpcom/glue/nsVoidArray.cpp b/xpcom/glue/nsVoidArray.cpp index e8ce6a1f0d3..a5c8442576e 100644 --- a/xpcom/glue/nsVoidArray.cpp +++ b/xpcom/glue/nsVoidArray.cpp @@ -732,6 +732,9 @@ nsStringArray::~nsStringArray(void) nsStringArray& nsStringArray::operator=(const nsStringArray& other) { + // Free our strings + Clear(); + // Copy the pointers nsVoidArray::operator=(other); @@ -982,6 +985,9 @@ nsCStringArray::~nsCStringArray(void) nsCStringArray& nsCStringArray::operator=(const nsCStringArray& other) { + // Free our strings + Clear(); + // Copy the pointers nsVoidArray::operator=(other);