From: mshabunin Date: Fri, 2 Dec 2016 15:41:25 +0000 (+0300) Subject: Fixed valgrind issues in persistence functions X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1362^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0e771f545333dd0711e16c944f1a585b40d97ab;p=platform%2Fupstream%2Fopencv.git Fixed valgrind issues in persistence functions --- diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index eacdcc5..40b846f 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -714,8 +714,8 @@ cvReleaseFileStorage( CvFileStorage** p_fs ) delete fs->outbuf; delete fs->base64_writer; - delete fs->delayed_struct_key; - delete fs->delayed_type_name; + delete[] fs->delayed_struct_key; + delete[] fs->delayed_type_name; memset( fs, 0, sizeof(*fs) ); cvFree( &fs ); @@ -1218,8 +1218,8 @@ static void check_if_write_struct_is_delayed( CvFileStorage* fs, bool change_typ } /* reset */ - delete fs->delayed_struct_key; - delete fs->delayed_type_name; + delete[] fs->delayed_struct_key; + delete[] fs->delayed_type_name; fs->delayed_struct_key = 0; fs->delayed_struct_flags = 0; fs->delayed_type_name = 0;