From 98df387ba96f83f364b1ba1be5f9a3ae9f79e931 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 3 Dec 2011 11:19:42 +0100 Subject: Fix memory error --- src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 94af9f2..9c79b31 100644 --- a/src/main.c +++ b/src/main.c @@ -1695,11 +1695,11 @@ gboolean hashlist_sync(hashlist_t* hlist, worker_data_t* data, if (!hashlist_item_sync(data, env, line, hlist->data + a++)) { hlist->added = hlist->data + hlist->fill; - hlist->data[a].hash = NULL; + if (a < hlist->size) hlist->data[a].hash = NULL; xmlrpc_DECREF(line); return FALSE; } - hlist->data[a].hash = NULL; + if (a < hlist->size) hlist->data[a].hash = NULL; xmlrpc_DECREF(line); continue; } @@ -1762,12 +1762,12 @@ gboolean hashlist_sync(hashlist_t* hlist, worker_data_t* data, torrent_data_init(hlist->data + a, hash); if (!hashlist_item_sync(data, env, line, hlist->data + a++)) { - hlist->data[a].hash = NULL; + if (a < hlist->size) hlist->data[a].hash = NULL; hlist->added = hlist->data + hlist->fill; xmlrpc_DECREF(line); return FALSE; } - hlist->data[a].hash = NULL; + if (a < hlist->size) hlist->data[a].hash = NULL; } xmlrpc_DECREF(line); } -- cgit v1.2.3-70-g09d2