From 60ac6ac5573b3ddb2d2d4d895ca1d48c53d385bc Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Sat, 23 Apr 2005 02:08:12 +0000 Subject: [PATCH] fix build bustage - use comptr to delete obj git-svn-id: svn://10.0.0.236/trunk@172637 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileUnix.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index 61eea4d8e63..b43f162643a 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -218,15 +218,14 @@ nsDirEnumeratorUnix::GetNextFile(nsIFile **_retval) return NS_OK; } - nsLocalFile* file = new nsLocalFile(); + nsCOMPtr file = new nsLocalFile(); if (!file) return NS_ERROR_OUT_OF_MEMORY; if (NS_FAILED(rv = file->InitWithNativePath(mParentPath)) || - NS_FAILED(rv = file->AppendNative(nsDependentCString(mEntry->d_name)))) { - delete file; + NS_FAILED(rv = file->AppendNative(nsDependentCString(mEntry->d_name)))) return rv; - } + *_retval = file; NS_ADDREF(*_retval); return GetNextEntry();