From 0eaeff06418223c89f86fc2fdcf48fbc90f4c4cb Mon Sep 17 00:00:00 2001 From: kurodash Date: Fri, 7 Mar 2014 19:02:37 +0900 Subject: [PATCH 1/2] fix: use "cvAlloc" wrapper function for malloc. --- modules/core/src/persistence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index 7759f708b6..4a6e0c9ec5 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -4855,7 +4855,7 @@ cvRegisterType( const CvTypeInfo* _info ) "Type name should contain only letters, digits, - and _" ); } - info = (CvTypeInfo*)malloc( sizeof(*info) + len + 1 ); + info = (CvTypeInfo*)cvAlloc( sizeof(*info) + len + 1 ); *info = *_info; info->type_name = (char*)(info + 1); @@ -4893,7 +4893,7 @@ cvUnregisterType( const char* type_name ) if( !CvType::first || !CvType::last ) CvType::first = CvType::last = 0; - free( info ); + cvFree( info ); } } From f9484bae8ab748132e753b8c217c5ded36a5c9dd Mon Sep 17 00:00:00 2001 From: kuroda sho Date: Fri, 14 Mar 2014 17:02:20 +0900 Subject: [PATCH 2/2] fix: use "cvAlloc" wrapper function for malloc. --- modules/core/src/persistence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index 4a6e0c9ec5..6847eec34d 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -4893,7 +4893,7 @@ cvUnregisterType( const char* type_name ) if( !CvType::first || !CvType::last ) CvType::first = CvType::last = 0; - cvFree( info ); + cvFree( &info ); } }