Skip to content

Commit

Permalink
ccmain/paragraphs: Fix memory leak
Browse files Browse the repository at this point in the history
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 <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 24, 2016
1 parent aa945bb commit bf334e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ccmain/paragraphs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bf334e0

Please sign in to comment.