Commit d76226e2 authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #2456 from kurodash:pr_use_cvAlloc

parents bfb1ba37 f9484bae
...@@ -4855,7 +4855,7 @@ cvRegisterType( const CvTypeInfo* _info ) ...@@ -4855,7 +4855,7 @@ cvRegisterType( const CvTypeInfo* _info )
"Type name should contain only letters, digits, - and _" ); "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 = *_info;
info->type_name = (char*)(info + 1); info->type_name = (char*)(info + 1);
...@@ -4893,7 +4893,7 @@ cvUnregisterType( const char* type_name ) ...@@ -4893,7 +4893,7 @@ cvUnregisterType( const char* type_name )
if( !CvType::first || !CvType::last ) if( !CvType::first || !CvType::last )
CvType::first = CvType::last = 0; CvType::first = CvType::last = 0;
free( info ); cvFree( &info );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment