From bf334e0477cae5c16852b2b868da4df2543bf318 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 24 Oct 2016 13:37:03 +0200 Subject: [PATCH] ccmain/paragraphs: Fix memory leak Coverity report: CID 1164737 (#1 of 1): Resource leak (RESOURCE_LEAK) 49. leaked_storage: Variable p going out of scope leaks the storage it points to. Signed-off-by: Stefan Weil --- ccmain/paragraphs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ccmain/paragraphs.cpp b/ccmain/paragraphs.cpp index b46f9f3e64..7459940dd0 100644 --- a/ccmain/paragraphs.cpp +++ b/ccmain/paragraphs.cpp @@ -2113,6 +2113,7 @@ void ConvertHypothesizedModelRunsToParagraphs( if ((*row_owners)[row] != NULL) { tprintf("Memory leak! ConvertHypothesizeModelRunsToParagraphs() called " "more than once!\n"); + delete (*row_owners)[row]; } (*row_owners)[row] = p; }