From Jakub Zawadzki:
More remove checking for NULL before g_free(). svn path=/trunk/; revision=27728
This commit is contained in:
parent
0f9f5caf9d
commit
0258be0b05
|
@ -336,8 +336,7 @@ free_if_cb(gpointer data, gpointer user_data _U_)
|
|||
if_info_t *if_info = data;
|
||||
|
||||
g_free(if_info->name);
|
||||
if (if_info->description != NULL)
|
||||
g_free(if_info->description);
|
||||
g_free(if_info->description);
|
||||
|
||||
g_slist_foreach(if_info->ip_addr, free_if_info_addr_cb, NULL);
|
||||
g_slist_free(if_info->ip_addr);
|
||||
|
@ -550,8 +549,7 @@ free_linktype_cb(gpointer data, gpointer user_data _U_)
|
|||
data_link_info_t *linktype_info = data;
|
||||
|
||||
g_free(linktype_info->name);
|
||||
if (linktype_info->description != NULL)
|
||||
g_free(linktype_info->description);
|
||||
g_free(linktype_info->description);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -4137,10 +4137,8 @@ dcm_set_syntax(dcm_state_pctx_t *pctx, gchar *xfer_uid, gchar *xfer_desc)
|
|||
if ((pctx == NULL) || (xfer_uid == NULL) || (xfer_desc == NULL))
|
||||
return;
|
||||
|
||||
if (pctx->xfer_uid != NULL)
|
||||
g_free(pctx->xfer_uid); /* free prev allocated xfer */
|
||||
if (pctx->xfer_desc != NULL)
|
||||
g_free(pctx->xfer_desc); /* free prev allocated xfer */
|
||||
g_free(pctx->xfer_uid); /* free prev allocated xfer */
|
||||
g_free(pctx->xfer_desc); /* free prev allocated xfer */
|
||||
|
||||
pctx->syntax = 0;
|
||||
pctx->xfer_uid = g_strdup(xfer_uid);
|
||||
|
@ -5540,7 +5538,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
vr = (gchar *)tvb_get_ephemeral_string(tvb, offset, 2);
|
||||
offset += 2;
|
||||
|
||||
if (pdv->open_tag.vr) g_free(pdv->open_tag.vr); /* Free if needed */
|
||||
g_free(pdv->open_tag.vr);
|
||||
pdv->open_tag.vr = g_strdup(vr); /* needs to survive withing a session */
|
||||
}
|
||||
|
||||
|
|
|
@ -1217,8 +1217,7 @@ TimeZoneFaster(time_t t)
|
|||
else
|
||||
tdt = g_realloc(dst_table, sizeof(dst_table[0])*(i+1));
|
||||
if (tdt == NULL) {
|
||||
if (dst_table)
|
||||
g_free(dst_table);
|
||||
g_free(dst_table);
|
||||
table_size = 0;
|
||||
} else {
|
||||
dst_table = tdt;
|
||||
|
|
12
file.c
12
file.c
|
@ -1438,8 +1438,7 @@ cf_filter_packets(capture_file *cf, gchar *dftext, gboolean force)
|
|||
}
|
||||
|
||||
/* We have a valid filter. Replace the current filter. */
|
||||
if (cf->dfilter != NULL)
|
||||
g_free(cf->dfilter);
|
||||
g_free(cf->dfilter);
|
||||
cf->dfilter = dftext;
|
||||
|
||||
/* Now rescan the packet list, applying the new filter, but not
|
||||
|
@ -2198,12 +2197,9 @@ cf_print_packets(capture_file *cf, print_args_t *print_args)
|
|||
"selected packets", TRUE, print_packet,
|
||||
&callback_args);
|
||||
|
||||
if (callback_args.header_line_buf != NULL)
|
||||
g_free(callback_args.header_line_buf);
|
||||
if (callback_args.line_buf != NULL)
|
||||
g_free(callback_args.line_buf);
|
||||
if (callback_args.col_widths != NULL)
|
||||
g_free(callback_args.col_widths);
|
||||
g_free(callback_args.header_line_buf);
|
||||
g_free(callback_args.line_buf);
|
||||
g_free(callback_args.col_widths);
|
||||
|
||||
switch (ret) {
|
||||
|
||||
|
|
|
@ -129,9 +129,7 @@ protocolinfo_init(const char *optarg, void* userdata _U_)
|
|||
fprintf(stderr, "tshark: Couldn't register proto,colinfo tap: %s\n",
|
||||
error_string->str);
|
||||
g_string_free(error_string, TRUE);
|
||||
if(rs->filter){
|
||||
g_free(rs->filter);
|
||||
}
|
||||
g_free(rs->filter);
|
||||
g_free(rs);
|
||||
|
||||
exit(1);
|
||||
|
|
3
tshark.c
3
tshark.c
|
@ -2313,8 +2313,7 @@ out:
|
|||
wtap_close(cf->wth);
|
||||
cf->wth = NULL;
|
||||
|
||||
if (save_file_string != NULL)
|
||||
g_free(save_file_string);
|
||||
g_free(save_file_string);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
28
update.c
28
update.c
|
@ -118,23 +118,14 @@ update_info_new(void)
|
|||
void
|
||||
update_info_delete(update_info_t *update_info)
|
||||
{
|
||||
if(update_info->prefix)
|
||||
g_free(update_info->prefix);
|
||||
if(update_info->version_installed)
|
||||
g_free(update_info->version_installed);
|
||||
|
||||
if(update_info->title)
|
||||
g_free(update_info->title);
|
||||
if(update_info->description)
|
||||
g_free(update_info->description);
|
||||
if(update_info->version_recommended)
|
||||
g_free(update_info->version_recommended);
|
||||
if(update_info->url)
|
||||
g_free(update_info->url);
|
||||
if(update_info->md5)
|
||||
g_free(update_info->md5);
|
||||
if(update_info->size)
|
||||
g_free(update_info->size);
|
||||
g_free(update_info->prefix);
|
||||
g_free(update_info->version_installed);
|
||||
g_free(update_info->title);
|
||||
g_free(update_info->description);
|
||||
g_free(update_info->version_recommended);
|
||||
g_free(update_info->url);
|
||||
g_free(update_info->md5);
|
||||
g_free(update_info->size);
|
||||
|
||||
g_free(update_info);
|
||||
}
|
||||
|
@ -293,8 +284,7 @@ update_check_winpcap(const char *local_file)
|
|||
}
|
||||
|
||||
g_string_free(pcap_version_tmp, TRUE);
|
||||
if(pcap_version)
|
||||
g_free(pcap_version);
|
||||
g_free(pcap_version);
|
||||
|
||||
return update_info;
|
||||
}
|
||||
|
|
|
@ -543,12 +543,8 @@ static k12_t* new_k12_file_data(void) {
|
|||
static gboolean destroy_srcdsc(gpointer k _U_, gpointer v, gpointer p _U_) {
|
||||
k12_src_desc_t* rec = v;
|
||||
|
||||
if(rec->input_name)
|
||||
g_free(rec->input_name);
|
||||
|
||||
if(rec->stack_file)
|
||||
g_free(rec->stack_file);
|
||||
|
||||
g_free(rec->input_name);
|
||||
g_free(rec->stack_file);
|
||||
g_free(rec);
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue