Skip to content

Commit

Permalink
2002-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Browse files Browse the repository at this point in the history
	* icall.c:
	* socket-io.c:
	* unicode.c: free some strings gotten from mono_string_to_utf8 and
	changed a couple of free () by g_free ().

svn path=/trunk/mono/; revision=4021
  • Loading branch information
gonzalop committed Apr 24, 2002
1 parent c61c1b8 commit 73e0b71
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
7 changes: 7 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,10 @@
2002-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* icall.c:
* socket-io.c:
* unicode.c: free some strings gotten from mono_string_to_utf8 and
changed a couple of free () by g_free ().

2002-04-24 Patrik Torstensson <patrik.torstensson@labs2.com>

* object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
Expand Down
12 changes: 9 additions & 3 deletions mono/metadata/icall.c
Expand Up @@ -1694,8 +1694,10 @@ ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, Mon
while (*p) {
switch (*p) {
case '&':
if (isbyref) /* only one level allowed by the spec */
if (isbyref) { /* only one level allowed by the spec */
g_free (str);
return NULL;
}
isbyref = 1;
p++;
return mono_type_get_object (mono_domain_get (), &klass->this_arg);
Expand All @@ -1713,12 +1715,16 @@ ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, Mon
break;
if (*p == ',')
rank++;
else if (*p != '*') /* '*' means unknown lower bound */
else if (*p != '*') { /* '*' means unknown lower bound */
g_free (str);
return NULL;
}
++p;
}
if (*p != ']')
if (*p != ']') {
g_free (str);
return NULL;
}
p++;
klass = mono_array_class_get (&klass->byval_arg, rank);
mono_class_init (klass);
Expand Down
5 changes: 3 additions & 2 deletions mono/metadata/socket-io.c
Expand Up @@ -1281,7 +1281,7 @@ extern gboolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host

hostname=mono_string_to_utf8(host);
he=gethostbyname(hostname);
free(hostname);
g_free(hostname);

if(he==NULL) {
return(FALSE);
Expand Down Expand Up @@ -1337,10 +1337,11 @@ extern gboolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr

address = mono_string_to_utf8 (addr);
if (inet_pton (AF_INET, address, &inaddr) <= 0) {
free (address);
g_free (address);
return FALSE;
}

g_free (address);
if ((he = gethostbyaddr ((char *) &inaddr, sizeof (inaddr), AF_INET)) == NULL)
return FALSE;

Expand Down
2 changes: 2 additions & 0 deletions mono/metadata/unicode.c
Expand Up @@ -175,6 +175,7 @@ ves_icall_iconv_new_encoder (MonoString *name, MonoBoolean big_endian)
cd = iconv_open (n, "UTF-16");
#endif
g_assert (cd != (iconv_t)-1);
g_free (n);

return (gpointer)cd;
}
Expand Down Expand Up @@ -202,6 +203,7 @@ ves_icall_iconv_new_decoder (MonoString *name, MonoBoolean big_endian)
cd = iconv_open ("UTF-16", n);
#endif
g_assert (cd != (iconv_t)-1);
g_free (n);

return (gpointer)cd;
}
Expand Down

0 comments on commit 73e0b71

Please sign in to comment.