diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/sctp_assoc_analyse.c | 4 | ||||
-rw-r--r-- | gtk/sctp_stat.c | 40 | ||||
-rw-r--r-- | gtk/tcp_graph.c | 80 | ||||
-rw-r--r-- | gtk/ui_util.c | 2 |
4 files changed, 63 insertions, 63 deletions
diff --git a/gtk/sctp_assoc_analyse.c b/gtk/sctp_assoc_analyse.c index 25e7a5a1ef..15881c4634 100644 --- a/gtk/sctp_assoc_analyse.c +++ b/gtk/sctp_assoc_analyse.c @@ -752,9 +752,9 @@ void sctp_analyse_cb(struct sctp_analyse* u_data) return; } - ip_src = malloc(edt->pi.src.len); + ip_src = g_malloc(edt->pi.src.len); memcpy(ip_src, edt->pi.src.data, edt->pi.src.len); - ip_dst = malloc(edt->pi.dst.len); + ip_dst = g_malloc(edt->pi.dst.len); memcpy(ip_dst, edt->pi.dst.data, edt->pi.dst.len); srcport = edt->pi.srcport; dstport = edt->pi.destport; diff --git a/gtk/sctp_stat.c b/gtk/sctp_stat.c index e712d7cb62..2b2dc3b54d 100644 --- a/gtk/sctp_stat.c +++ b/gtk/sctp_stat.c @@ -791,7 +791,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v tmp_info.src.len = 16; } - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr, sctp_info->ip_src.data, tmp_info.src.len); tmp_info.src.data = addr; @@ -808,7 +808,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v tmp_info.dst.len = 16; } - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr, sctp_info->ip_dst.data, tmp_info.dst.len); tmp_info.dst.data = addr; @@ -839,12 +839,12 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v memset(info, 0, sizeof(sctp_assoc_info_t)); info->src.type = tmp_info.src.type; info->src.len = tmp_info.src.len; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr,(tmp_info.src.data), tmp_info.src.len); info->src.data = addr; info->dst.type = tmp_info.dst.type; info->dst.len = tmp_info.dst.len; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr, (tmp_info.dst.data), tmp_info.dst.len); info->dst.data = addr; info->port1 = tmp_info.port1; @@ -904,18 +904,18 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v sack->tsns = NULL; sack->src.type=tsn->src.type = tmp_info.src.type; sack->src.len=tsn->src.len = tmp_info.src.len; - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr, tmp_info.src.data, tmp_info.src.len); tsn->src.data = addr; - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr, tmp_info.src.data, tmp_info.src.len); sack->src.data = addr; sack->dst.type = tsn->dst.type = tmp_info.dst.type; sack->dst.len =tsn->dst.len = tmp_info.dst.len; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); tsn->dst.data = addr; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); sack->dst.data = addr; sack->secs=tsn->secs = (guint32)pinfo->fd->rel_secs; @@ -956,7 +956,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = AT_IPv4;; store->len = 4; - store->data = malloc(4); + store->data = g_malloc(4); tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV4_ADDRESS_OFFSET, 4); info = add_address(store, info, 1); } @@ -965,7 +965,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = AT_IPv6;; store->len = 16; - store->data = malloc(16); + store->data = g_malloc(16); tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH); info = add_address(store, info, 1); } @@ -1070,14 +1070,14 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = tmp_info.src.type; store->len = tmp_info.src.len; - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr,(tmp_info.src.data),tmp_info.src.len); store->data = addr; info = add_address(store, info, 1); store = g_malloc(sizeof (address)); store->type = tmp_info.dst.type; store->len = tmp_info.dst.len; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr,(tmp_info.dst.data),tmp_info.dst.len); store->data = addr; info = add_address(store, info, 2); @@ -1118,18 +1118,18 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v sack->tsns = NULL; sack->src.type = tsn->src.type = tmp_info.src.type; sack->src.len = tsn->src.len = tmp_info.src.len; - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr, tmp_info.src.data, tmp_info.src.len); tsn->src.data = addr; - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr, tmp_info.src.data, tmp_info.src.len); sack->src.data = addr; sack->dst.type = tsn->dst.type = tmp_info.dst.type; sack->dst.len = tsn->dst.len = tmp_info.dst.len; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); tsn->dst.data = addr; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr, tmp_info.dst.data, tmp_info.dst.len); sack->dst.data = addr; sack->secs=tsn->secs = (guint32)pinfo->fd->rel_secs; @@ -1160,7 +1160,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = tmp_info.src.type; store->len = tmp_info.src.len; - addr = malloc(tmp_info.src.len); + addr = g_malloc(tmp_info.src.len); memcpy(addr,(tmp_info.src.data),tmp_info.src.len); store->data = addr; @@ -1172,7 +1172,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = tmp_info.dst.type; store->len = tmp_info.dst.len; - addr = malloc(tmp_info.dst.len); + addr = g_malloc(tmp_info.dst.len); memcpy(addr,(tmp_info.dst.data),tmp_info.dst.len); store->data = addr; @@ -1222,7 +1222,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = AT_IPv4;; store->len = 4; - store->data = malloc(4); + store->data = g_malloc(4); tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV4_ADDRESS_OFFSET, 4); info = add_address(store, info, info->direction); } @@ -1231,7 +1231,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v store = g_malloc(sizeof (address)); store->type = AT_IPv6;; store->len = 16; - store->data = malloc(16); + store->data = g_malloc(16); tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(store->data),IPV6_ADDRESS_OFFSET, IPV6_ADDRESS_LENGTH); info = add_address(store, info, info->direction); } diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 5ab653c2e2..c79ca601b2 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -1604,11 +1604,11 @@ static struct graph *graph_new (void) { struct graph *g; - g = (struct graph * )calloc (1, sizeof (struct graph)); + g = (struct graph * )g_malloc0 (sizeof (struct graph)); graph_element_lists_initialize (g); - g->x_axis = (struct axis * )calloc (1, sizeof (struct axis)); - g->y_axis = (struct axis * )calloc (1, sizeof (struct axis)); + g->x_axis = (struct axis * )g_malloc0 (sizeof (struct axis)); + g->y_axis = (struct axis * )g_malloc0 (sizeof (struct axis)); g->x_axis->g = g; g->x_axis->flags = 0; g->x_axis->flags |= AXIS_ORIENTATION; @@ -1725,9 +1725,9 @@ static void graph_destroy (struct graph *g) #endif gdk_pixmap_unref (g->pixmap[0]); gdk_pixmap_unref (g->pixmap[1]); - free (g->x_axis); - free (g->y_axis); - free (g->title); + g_free (g->x_axis); + g_free (g->y_axis); + g_free (g->title); graph_segment_list_free (g); graph_element_lists_free (g); #if 0 @@ -1740,7 +1740,7 @@ static void graph_destroy (struct graph *g) graphs = g->next; else p->next = g->next; - free (g); + g_free (g); #if 0 for (tmp=graphs; tmp; tmp=tmp->next) printf ("%p next: %p\n", tmp, tmp->next); @@ -1971,7 +1971,7 @@ static void graph_segment_list_free (struct graph *g) while (g->segments) { segment = g->segments->next; - free (g->segments); + g_free (g->segments); g->segments = segment; } g->segments = NULL; @@ -1979,7 +1979,7 @@ static void graph_segment_list_free (struct graph *g) static void graph_element_lists_initialize (struct graph *g) { - g->elists = (struct element_list *)calloc (1, sizeof (struct element_list)); + g->elists = (struct element_list *)g_malloc0 (sizeof (struct element_list)); } static void graph_element_lists_make (struct graph *g) @@ -2011,18 +2011,18 @@ static void graph_element_lists_free (struct graph *g) #if 0 for (list=g->elists; list; list=list->next) - free (list->elements); + g_free (list->elements); while (g->elists->next) { list = g->elists->next->next; - free (g->elists->next); + g_free (g->elists->next); g->elists->next = list; } #endif for (list=g->elists; list; list=next_list) { - free (list->elements); + g_free (list->elements); next_list = list->next; - free (list); + g_free (list); } g->elists = NULL; /* just to make debugging easier */ } @@ -2210,7 +2210,7 @@ static void axis_destroy (struct axis *axis) { gdk_pixmap_unref (axis->pixmap[0]); gdk_pixmap_unref (axis->pixmap[1]); - free (axis->label); + g_free (axis->label); } static void axis_display (struct axis *axis) @@ -2716,7 +2716,7 @@ static void magnify_create (struct graph *g, int x, int y) struct ipoint pos, offsetpos; GdkEvent *e=NULL; - mg = g->magnify.g = (struct graph * )malloc (sizeof (struct graph)); + mg = g->magnify.g = (struct graph * )g_malloc (sizeof (struct graph)); memcpy ((void * )mg, (void * )g, sizeof (struct graph)); mg->toplevel = dlg_window_new("tcp graph magnify"); @@ -2742,7 +2742,7 @@ static void magnify_create (struct graph *g, int x, int y) new_list = mg->elists; for ( ; list; list=list->next) { new_list->next = - (struct element_list * )malloc (sizeof (struct element_list)); + (struct element_list * )g_malloc (sizeof (struct element_list)); new_list = new_list->next; new_list->next = NULL; new_list->elements = NULL; @@ -2806,13 +2806,13 @@ static void magnify_destroy (struct graph *g) gdk_pixmap_unref (mg->pixmap[0]); gdk_pixmap_unref (mg->pixmap[1]); for (list=mg->elists; list; list=list->next) - free (list->elements); + g_free (list->elements); while (mg->elists->next) { list = mg->elists->next->next; - free (mg->elists->next); + g_free (mg->elists->next); mg->elists->next = list; } - free (g->magnify.g); + g_free (g->magnify.g); g->magnify.active = 0; } @@ -3297,14 +3297,14 @@ static void tseq_stevens_read_config (struct graph *g) g->s.tseq_stevens.seq_height = 4; g->s.tseq_stevens.flags = 0; - g->title = (char ** )malloc (2 * sizeof (char *)); + g->title = (char ** )g_malloc (2 * sizeof (char *)); g->title[0] = "Time/Sequence Graph"; g->title[1] = NULL; - g->y_axis->label = (char ** )malloc (3 * sizeof (char * )); + g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * )); g->y_axis->label[0] = "number[B]"; g->y_axis->label[1] = "Sequence"; g->y_axis->label[2] = NULL; - g->x_axis->label = (char ** )malloc (2 * sizeof (char * )); + g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * )); g->x_axis->label[0] = "Time[s]"; g->x_axis->label[1] = NULL; } @@ -3397,7 +3397,7 @@ static void tseq_stevens_make_elmtlist (struct graph *g) debug(DBS_FENTRY) puts ("tseq_stevens_make_elmtlist()"); if (g->elists->elements == NULL) { int n = 1 + get_num_dsegs (g); - e = elements = (struct element * )malloc (n*sizeof (struct element)); + e = elements = (struct element * )g_malloc (n*sizeof (struct element)); } else e = elements = g->elists->elements; @@ -3512,18 +3512,18 @@ static void tseq_tcptrace_read_config (struct graph *g) gdk_gc_set_foreground (g->s.tseq_tcptrace.gc_ack[1], &color); g->elists->next = (struct element_list * ) - malloc (sizeof (struct element_list)); + g_malloc (sizeof (struct element_list)); g->elists->next->next = NULL; g->elists->next->elements = NULL; - g->title = (char ** )malloc (2 * sizeof (char *)); + g->title = (char ** )g_malloc (2 * sizeof (char *)); g->title[0] = "Time/Sequence Graph"; g->title[1] = NULL; - g->y_axis->label = (char ** )malloc (3 * sizeof (char * )); + g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * )); g->y_axis->label[0] = "number[B]"; g->y_axis->label[1] = "Sequence"; g->y_axis->label[2] = NULL; - g->x_axis->label = (char ** )malloc (2 * sizeof (char * )); + g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * )); g->x_axis->label[0] = "Time[s]"; g->x_axis->label[1] = NULL; } @@ -3544,13 +3544,13 @@ static void tseq_tcptrace_make_elmtlist (struct graph *g) if (g->elists->elements == NULL) { int n = 1 + 4*get_num_acks(g); - e0 = elements0 = (struct element * )malloc (n*sizeof (struct element)); + e0 = elements0 = (struct element * )g_malloc (n*sizeof (struct element)); } else e0 = elements0 = g->elists->elements; if (g->elists->next->elements == NULL ) { int n = 1 + 3*get_num_dsegs(g); - e1 = elements1 = (struct element * )malloc (n*sizeof (struct element)); + e1 = elements1 = (struct element * )g_malloc (n*sizeof (struct element)); } else e1 = elements1 = g->elists->next->elements; @@ -3705,7 +3705,7 @@ static void tput_make_elmtlist (struct graph *g) if (g->elists->elements == NULL) { int n = 1 + get_num_dsegs (g); - e = elements = (struct element * )malloc (n*sizeof (struct element)); + e = elements = (struct element * )g_malloc (n*sizeof (struct element)); } else e = elements = g->elists->elements; @@ -3788,14 +3788,14 @@ static void tput_read_config (struct graph *g) g->s.tput.height = 4; g->s.tput.nsegs = 20; - g->title = (char ** )malloc (2 * sizeof (char *)); + g->title = (char ** )g_malloc (2 * sizeof (char *)); g->title[0] = "Throughput Graph"; g->title[1] = NULL; - g->y_axis->label = (char ** )malloc (3 * sizeof (char * )); + g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * )); g->y_axis->label[0] = "[B/s]"; g->y_axis->label[1] = "Throughput"; g->y_axis->label[2] = NULL; - g->x_axis->label = (char ** )malloc (2 * sizeof (char * )); + g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * )); g->x_axis->label[0] = "Time[s]"; g->x_axis->label[1] = NULL; g->s.tput.flags = 0; @@ -3821,13 +3821,13 @@ static void rtt_read_config (struct graph *g) g->s.rtt.height = 4; g->s.rtt.flags = 0; - g->title = (char ** )malloc (2 * sizeof (char *)); + g->title = (char ** )g_malloc (2 * sizeof (char *)); g->title[0] = "Round Trip Time Graph"; g->title[1] = NULL; - g->y_axis->label = (char ** )malloc (3 * sizeof (char * )); + g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * )); g->y_axis->label[0] = "RTT [s]"; g->y_axis->label[1] = NULL; - g->x_axis->label = (char ** )malloc (2 * sizeof (char * )); + g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * )); g->x_axis->label[0] = "Sequence Number[B]"; g->x_axis->label[1] = NULL; } @@ -3911,7 +3911,7 @@ static struct unack *rtt_get_new_unack (double time, unsigned int seqno) { struct unack *u; - u = (struct unack * )malloc (sizeof (struct unack)); + u = (struct unack * )g_malloc (sizeof (struct unack)); if (!u) return NULL; u->next = NULL; @@ -3943,12 +3943,12 @@ static void rtt_delete_unack_from_list (struct unack **l, struct unack *dead) if (dead==list) { *l = list->next; - free (list); + g_free (list); } else for (u=list; u; u=u->next) if (u->next == dead) { u->next = u->next->next; - free (dead); + g_free (dead); break; } } @@ -3964,7 +3964,7 @@ static void rtt_make_elmtlist (struct graph *g) if (g->elists->elements == NULL) { int n = 1 + get_num_dsegs (g); - e = elements = (struct element * )malloc (n*sizeof (struct element)); + e = elements = (struct element * )g_malloc (n*sizeof (struct element)); } else { e = elements = g->elists->elements; } diff --git a/gtk/ui_util.c b/gtk/ui_util.c index 3c4c560ca1..9177cf9eb5 100644 --- a/gtk/ui_util.c +++ b/gtk/ui_util.c @@ -417,7 +417,7 @@ window_geom_save(const gchar *name, window_geometry_t *geom) g_free(work); } - /* malloc and insert the new one */ + /* g_malloc and insert the new one */ work = g_malloc(sizeof(*geom)); *work = *geom; key = g_strdup(name); |