From: Aleksey Kliger (λgeek) Date: Mon, 12 Aug 2019 13:50:58 +0000 (-0400) Subject: [debugger] Cleanup MonoError on in isFixedSizeArray (mono/mono#16146) X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~813 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62fb73ac2998f7a32c943ff303672ca740b1644c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [debugger] Cleanup MonoError on in isFixedSizeArray (mono/mono#16146) Cleanup MonoError on error paths. Also change `return FALSE` to `return 0`. Addresses Coverity CID 1452205 Commit migrated from https://github.com/mono/mono/commit/dd3f6e0d31a055f616e42561383e0365c8fc6e4c --- diff --git a/src/mono/mono/mini/debugger-agent.c b/src/mono/mono/mini/debugger-agent.c index 377d064..208f1fa 100644 --- a/src/mono/mono/mini/debugger-agent.c +++ b/src/mono/mono/mini/debugger-agent.c @@ -3231,8 +3231,7 @@ static gint32 isFixedSizeArray (MonoClassField *f) int aindex; gint32 ret = 1; cinfo = mono_custom_attrs_from_field_checked (f->parent, f, error); - if (!is_ok (error)) - return ret; + goto_if_nok (error, leave); attr = NULL; if (cinfo) { for (aindex = 0; aindex < cinfo->num_attrs; ++aindex) { @@ -3246,8 +3245,10 @@ static gint32 isFixedSizeArray (MonoClassField *f) mono_reflection_create_custom_attr_data_args_noalloc (mono_defaults.corlib, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &num_named_args, &arginfo, error); - if (!is_ok (error)) - return FALSE; + if (!is_ok (error)) { + ret = 0; + goto leave; + } ret = *(gint32*)typed_args [1]; g_free (typed_args); g_free (named_args); @@ -3256,6 +3257,8 @@ static gint32 isFixedSizeArray (MonoClassField *f) } } } +leave: + mono_error_cleanup (error); return ret; }