ICALL_EXPORT MonoStringHandle
ves_icall_System_Environment_GetEnvironmentVariable_native (const gchar *utf8_name, MonoError *error)
{
- const gchar *value;
+ gchar *value;
if (utf8_name == NULL)
return NULL_HANDLE_STRING;
if (value == 0)
return NULL_HANDLE_STRING;
- return mono_string_new_handle (mono_domain_get (), value, error);
+ MonoStringHandle res = mono_string_new_handle (mono_domain_get (), value, error);
+ g_free (value);
+ return res;
}
/*