From 81522e96e9c996c50fefef0b9604853a7d9a8fab Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 29 Jan 2004 18:00:33 +0000 Subject: Fix mem leak. 2004-01-29 Christian Persch * embed/mozilla/EphyHeaderSniffer.cpp: Fix mem leak. --- embed/mozilla/EphyHeaderSniffer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/EphyHeaderSniffer.cpp b/embed/mozilla/EphyHeaderSniffer.cpp index 8d8e2d0b3..abf0ba931 100644 --- a/embed/mozilla/EphyHeaderSniffer.cpp +++ b/embed/mozilla/EphyHeaderSniffer.cpp @@ -328,8 +328,9 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI) } /* FIXME: how to inform user of failed save ? */ - nsILocalFile *destFile; - BuildDownloadPath (NS_ConvertUCS2toUTF8 (defaultFileName).get(), &destFile); + nsCOMPtr destFile; + BuildDownloadPath (NS_ConvertUCS2toUTF8 (defaultFileName).get(), getter_AddRefs (destFile)); + NS_ENSURE_TRUE (destFile, NS_ERROR_FAILURE); return InitiateDownload (destFile); } -- cgit v1.2.3