Author: ankit
Date: 2006-06-02 07:55:05 -0400 (Fri, 02 Jun 2006)
New Revision: 61404
Modified:
branches/mono-1-1-13/mono/mono/dis/ChangeLog
branches/mono-1-1-13/mono/mono/dis/get.c
Log:
* get.c (dis_stringify_method_signature_full): Fix two memory leaks.
Modified: branches/mono-1-1-13/mono/mono/dis/ChangeLog
===================================================================
--- branches/mono-1-1-13/mono/mono/dis/ChangeLog 2006-06-02 11:54:43 UTC
(rev 61403)
+++ branches/mono-1-1-13/mono/mono/dis/ChangeLog 2006-06-02 11:55:05 UTC
(rev 61404)
@@ -1,5 +1,9 @@
2006-06-02 Ankit Jain <[EMAIL PROTECTED]>
+ * get.c (dis_stringify_method_signature_full): Fix two memory leaks.
+
+2006-06-02 Ankit Jain <[EMAIL PROTECTED]>
+
* main.c (dis_method_list): Print only the method name in "{ // end
of.."
Modified: branches/mono-1-1-13/mono/mono/dis/get.c
===================================================================
--- branches/mono-1-1-13/mono/mono/dis/get.c 2006-06-02 11:54:43 UTC (rev
61403)
+++ branches/mono-1-1-13/mono/mono/dis/get.c 2006-06-02 11:55:05 UTC (rev
61404)
@@ -857,7 +857,7 @@
guint32 pcols [MONO_PARAM_SIZE];
guint32 param_index = 0, next_param_index = 0;
gboolean has_param_row;
- const char *name = "", *method_name = "";
+ const char *method_name = "";
int free_method = 0;
char *retval, *esname;
char *type = NULL;
@@ -907,8 +907,8 @@
start = method->hasthis ? 0 : 1;
for (i = 0; i < method->param_count + 1; ++i) {
marshal_info = NULL;
- name = "";
has_param_row = param_index && param_index < next_param_index;
+ esname = NULL;
if (method->param_count == 0 && !has_param_row)
/* method has zero parameters, and no row for return
val in the PARAM table */
@@ -919,7 +919,8 @@
if (has_param_row && i == pcols [MONO_PARAM_SEQUENCE]) {
if (i)
- name = mono_metadata_string_heap (m, pcols
[MONO_PARAM_NAME]);
+ esname = get_escaped_name (
+ mono_metadata_string_heap (m,
pcols [MONO_PARAM_NAME]));
if (with_marshal_info && (pcols [MONO_PARAM_FLAGS] &
PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL)) {
const char *tp;
@@ -936,7 +937,8 @@
param_index ++;
} else {
if (i)
- name = g_strdup_printf ("A_%i", i - start);
+ /* A_[0-9]* does not require escaping */
+ esname = g_strdup_printf ("A_%i", i - start);
}
if (!i)
@@ -947,7 +949,6 @@
retval = dis_stringify_param (m, method->params [i - 1]);
- esname = get_escaped_name (name);
g_string_append_printf (result, "%s%s %s", retval, marshal_info
? marshal_info : "", esname);
g_free (retval);
g_free (esname);
@@ -966,6 +967,7 @@
char *estype = get_escaped_name (type);
g_string_sprintfa (result_ret, "%s::", estype);
g_free (estype);
+ g_free (type);
}
esname = get_escaped_name (method_name);
g_string_append (result_ret, esname);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches