From 499c8c196513110b66b874b2ad95272dc9f936b6 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 11 May 1999 00:59:04 +0000 Subject: [PATCH] fix memory leak, and use nsAutoCString so I don't have to do the free or delete --- mailnews/news/src/nsNewsUtils.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mailnews/news/src/nsNewsUtils.cpp b/mailnews/news/src/nsNewsUtils.cpp index e16aa52eff6..7539e8dd81a 100644 --- a/mailnews/news/src/nsNewsUtils.cpp +++ b/mailnews/news/src/nsNewsUtils.cpp @@ -215,9 +215,7 @@ nsresult nsBuildNewsMessageURI(const char *baseURI, PRUint32 key, char** uri) if (tailURI.Find(kNewsRootURI) == 0) tailURI.Cut(0, kNewsRootURILen); - const char *tail = tailURI.ToNewCString(); - - *uri = PR_smprintf("%s%s#%d", kNewsMessageRootURI, tail, key); + *uri = PR_smprintf("%s%s#%d", kNewsMessageRootURI, (const char *)nsAutoCString(tailURI), key); return NS_OK; }