summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fe-common/irc/fe-netjoin.c8
-rw-r--r--src/fe-text/textbuffer-view.c8
-rw-r--r--src/irc/core/mode-lists.c4
-rw-r--r--src/irc/dcc/dcc.c2
-rw-r--r--src/irc/flood/flood.c4
-rw-r--r--src/perl/perl-common.c9
6 files changed, 19 insertions, 16 deletions
diff --git a/src/fe-common/irc/fe-netjoin.c b/src/fe-common/irc/fe-netjoin.c
index 90cf76b7..3d4bcc40 100644
--- a/src/fe-common/irc/fe-netjoin.c
+++ b/src/fe-common/irc/fe-netjoin.c
@@ -209,15 +209,15 @@ static void print_netjoins(NETJOIN_SERVER_REC *server)
old = gslist_find_icase_string(rec->old_channels,
realchannel);
if (old != NULL) {
- g_free(old->data);
+ void *data = old->data;
rec->old_channels =
- g_slist_remove(rec->old_channels,
- old->data);
+ g_slist_remove(rec->old_channels, data);
+ g_free(data);
}
- g_free(channel);
rec->now_channels =
g_slist_remove(rec->now_channels, channel);
+ g_free(channel);
}
if (rec->old_channels == NULL)
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c
index 77b21a2e..8eddae2f 100644
--- a/src/fe-text/textbuffer-view.c
+++ b/src/fe-text/textbuffer-view.c
@@ -268,11 +268,13 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
if (rec->count > 1) {
for (pos = 0; lines != NULL; pos++) {
- memcpy(&rec->lines[pos], lines->data,
+ void *data = lines->data;
+
+ memcpy(&rec->lines[pos], data,
sizeof(LINE_CACHE_SUB_REC));
- g_free(lines->data);
- lines = g_slist_remove(lines, lines->data);
+ lines = g_slist_remove(lines, data);
+ g_free(data);
}
}
diff --git a/src/irc/core/mode-lists.c b/src/irc/core/mode-lists.c
index 9d85e133..ee60f1b2 100644
--- a/src/irc/core/mode-lists.c
+++ b/src/irc/core/mode-lists.c
@@ -31,11 +31,11 @@ static void ban_free(GSList **list, BAN_REC *rec)
g_return_if_fail(list != NULL);
g_return_if_fail(rec != NULL);
+ *list = g_slist_remove(*list, rec);
+
g_free(rec->ban);
g_free_not_null(rec->setby);
g_free(rec);
-
- *list = g_slist_remove(*list, rec);
}
void banlist_free(GSList *banlist)
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index 9a4882e5..44ef3f20 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -57,8 +57,8 @@ void dcc_unregister_type(const char *type)
pos = gslist_find_string(dcc_types, type);
if (pos != NULL) {
- g_free(pos->data);
dcc_types = g_slist_remove(dcc_types, pos->data);
+ g_free(pos->data);
}
}
diff --git a/src/irc/flood/flood.c b/src/irc/flood/flood.c
index 320ec5c6..872db941 100644
--- a/src/irc/flood/flood.c
+++ b/src/irc/flood/flood.c
@@ -129,12 +129,12 @@ static void flood_hash_destroy(const char *key, FLOOD_REC *flood)
while (flood->items != NULL) {
FLOOD_ITEM_REC *rec = flood->items->data;
+ flood->items = g_slist_remove(flood->items, rec);
+
g_slist_foreach(rec->msgtimes, (GFunc) g_free, NULL);
g_slist_free(rec->msgtimes);
g_free(rec->target);
g_free(rec);
-
- flood->items = g_slist_remove(flood->items, rec);
}
g_free(flood->nick);
diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c
index cd23afe5..d39d351c 100644
--- a/src/perl/perl-common.c
+++ b/src/perl/perl-common.c
@@ -613,13 +613,14 @@ static int free_iobject_proto(void *key, void *value, void *chat_type)
static void perl_unregister_protocol(CHAT_PROTOCOL_REC *rec)
{
- GSList *item;
+ GSList *item;
+ void *data;
item = gslist_find_icase_string(use_protocols, rec->name);
if (item != NULL) {
- g_free(item->data);
- use_protocols =
- g_slist_remove(use_protocols, item->data);
+ data = item->data;
+ use_protocols = g_slist_remove(use_protocols, data);
+ g_free(data);
}
g_hash_table_foreach_remove(iobject_stashes,
(GHRFunc) free_iobject_proto,