[PATCH] riched20: Handle cp NULL more gracefully (Coverity)

Marcus Meissner marcus at jet.franken.de
Thu Jan 29 02:49:05 CST 2009


Hi,

CID 191, handle cp NULL more gracefully. ERR is printed
to help with later better error recovery if necessary.

Ciao, Marcus
---
 dlls/riched20/reader.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c
index b5fdb78..c5a3a35 100644
--- a/dlls/riched20/reader.c
+++ b/dlls/riched20/reader.c
@@ -1046,8 +1046,10 @@ static void ReadColorTbl(RTF_Info *info)
                 }
 
 		cp = New (RTFColor);
-		if (cp == NULL)
+		if (cp == NULL) {
 			ERR ( "%s: cannot allocate color entry\n", fn);
+			break;
+		}
 		cp->rtfCNum = cnum++;
 		cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = -1;
 		cp->rtfNextColor = info->colorList;
-- 
1.5.6



More information about the wine-patches mailing list