From 5bd56e7464871760c745cb42fa165354346d76d0 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Mon, 28 Jan 2013 17:57:19 -0500 Subject: [PATCH] Fix mem leak and mismatched new/delete --- modules/objdetect/src/matching.cpp | 1 + modules/ocl/src/initialization.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/objdetect/src/matching.cpp b/modules/objdetect/src/matching.cpp index 451fd03..11873b1 100644 --- a/modules/objdetect/src/matching.cpp +++ b/modules/objdetect/src/matching.cpp @@ -1212,6 +1212,7 @@ int maxFunctionalScore(const CvLSVMFilterObject **all_F, int n, free(tmpPartsDisplacement[i]); } free(tmpPoints); + free(tmpPartsDisplacement); free(tmpScore); free(tmpKPoints); diff --git a/modules/ocl/src/initialization.cpp b/modules/ocl/src/initialization.cpp index 63916d9..a239004 100644 --- a/modules/ocl/src/initialization.cpp +++ b/modules/ocl/src/initialization.cpp @@ -615,7 +615,7 @@ namespace cv CL_PROGRAM_BUILD_LOG, buildLogSize, buildLog, NULL)); cout << "\n\t\t\tBUILD LOG\n"; cout << buildLog << endl; - delete buildLog; + delete [] buildLog; } openCLVerifyCall(status); } -- 2.7.4