summaryrefslogtreecommitdiff
path: root/src/trg-torrent-model.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-05-02 10:19:27 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-05-02 10:19:27 +0000
commit4707e5f94ebcb702cc90af38dcd6487d603899b9 (patch)
tree68f4c09a4661ab7d4499168b4ae832d7e295354d /src/trg-torrent-model.c
parent4783c442c1811a8004bebaff9eea326fdd731ac9 (diff)
fix small list memory leak when a torrent is removed in active-only mode
Diffstat (limited to 'src/trg-torrent-model.c')
-rw-r--r--src/trg-torrent-model.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/trg-torrent-model.c b/src/trg-torrent-model.c
index c38b68e..d35e908 100644
--- a/src/trg-torrent-model.c
+++ b/src/trg-torrent-model.c
@@ -513,12 +513,13 @@ void trg_torrent_model_update(TrgTorrentModel * model, trg_client * tc,
} else if (mode > TORRENT_GET_MODE_FIRST) {
removedTorrents = get_torrents_removed(args);
if (removedTorrents) {
- for (li = json_array_get_elements(removedTorrents); li != NULL;
- li = g_list_next(li)) {
+ GList *hitlist = json_array_get_elements(removedTorrents);
+ for (li = hitlist; li; li = g_list_next(li)) {
id = json_node_get_int((JsonNode *) li->data);
g_hash_table_remove(priv->ht, &id);
addRemove = TRUE;
}
+ g_list_free(hitlist);
}
}