mirror of
https://github.com/opencv/opencv.git
synced 2025-06-25 05:32:14 +08:00
fix: use "cvAlloc" wrapper function for malloc.
This commit is contained in:
parent
229aa62300
commit
0eaeff0641
@ -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 )
|
|||||||
if( !CvType::first || !CvType::last )
|
if( !CvType::first || !CvType::last )
|
||||||
CvType::first = CvType::last = 0;
|
CvType::first = CvType::last = 0;
|
||||||
|
|
||||||
free( info );
|
cvFree( info );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user