Skip to content

Commit

Permalink
[metadata] Fix leaks when handling a few attributes (#16675) (#16851)
Browse files Browse the repository at this point in the history
Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.
  • Loading branch information
BrzVlad authored Sep 16, 2019
1 parent 7da9a04 commit a6b5187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mono/metadata/marshal-ilgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ get_fixed_buffer_attr (MonoClassField *field, MonoType **out_etype, int *out_len
return FALSE;
*out_etype = (MonoType*)typed_args [0];
*out_len = *(gint32*)typed_args [1];
g_free (typed_args [1]);
g_free (typed_args);
g_free (named_args);
g_free (arginfo);
Expand Down
2 changes: 2 additions & 0 deletions mono/metadata/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3907,7 +3907,9 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
} else {
g_assert_not_reached ();
}
g_free (named_args [i]);
}
g_free (typed_args [0]);
g_free (typed_args);
g_free (named_args);
g_free (arginfo);
Expand Down

0 comments on commit a6b5187

Please sign in to comment.