From 424de9b0812a426478fdf361bd5190225d6e4855 Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Thu, 12 Sep 2002 10:35:46 +0000 Subject: [PATCH] small fix 14835 sr=jag r=pav very small chance of a memory leak in nsFrame --- layout/generic/nsFrame.cpp | 4 +++- layout/html/base/src/nsFrame.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 247e42f000ad..4603f93610c5 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -343,8 +343,10 @@ SelectionImageService::CreateImage(nscolor aImageColor, imgIContainer *aContaine return NS_ERROR_OUT_OF_MEMORY; unsigned char *alpha = (unsigned char *)malloc(abpr); if (!alpha) + { + free (row_data); return NS_ERROR_OUT_OF_MEMORY; - + } unsigned char *data = row_data; PRInt16 i; diff --git a/layout/html/base/src/nsFrame.cpp b/layout/html/base/src/nsFrame.cpp index 247e42f000ad..4603f93610c5 100644 --- a/layout/html/base/src/nsFrame.cpp +++ b/layout/html/base/src/nsFrame.cpp @@ -343,8 +343,10 @@ SelectionImageService::CreateImage(nscolor aImageColor, imgIContainer *aContaine return NS_ERROR_OUT_OF_MEMORY; unsigned char *alpha = (unsigned char *)malloc(abpr); if (!alpha) + { + free (row_data); return NS_ERROR_OUT_OF_MEMORY; - + } unsigned char *data = row_data; PRInt16 i;