From bf9097eca7f244ccea9b08ad48ed4917b0e0b7d7 Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Tue, 27 Jul 1999 03:19:25 +0000 Subject: [PATCH] Fixed leak with GetAddress that now returns a copy. git-svn-id: svn://10.0.0.236/trunk@41231 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libimg/src/if.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mozilla/modules/libimg/src/if.cpp b/mozilla/modules/libimg/src/if.cpp index e4dc45ddd12..65bc8a8acdf 100644 --- a/mozilla/modules/libimg/src/if.cpp +++ b/mozilla/modules/libimg/src/if.cpp @@ -1010,8 +1010,8 @@ IL_StreamFirstWrite(il_container *ic, const unsigned char *str, int32 len) FREE_IF_NOT_NULL(ic->fetch_url); - if((ic->url)&& ic->url->GetAddress()){ - ic->fetch_url = PL_strdup(ic->url->GetAddress()); + if (ic->url){ + ic->fetch_url = ic->url->GetAddress(); } else{ if(ic->url_address) /* check needed because of mkicons.c */ @@ -1608,8 +1608,9 @@ IL_StreamCreated(il_container *ic, ic->type = (int)type; ic->content_length = url->GetContentLength(); - ILTRACE(4,("il: new stream, type %d, %s", ic->type, - url->GetAddress())); + char* addr = url->GetAddress(); + ILTRACE(4,("il: new stream, type %d, %s", ic->type, addr)); + nsCRT::free(addr); ic->state = IC_STREAM; #ifndef M12N /* XXXM12N Fix me. */