diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2011-12-03 11:19:42 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2011-12-03 11:19:42 +0100 |
| commit | 98df387ba96f83f364b1ba1be5f9a3ae9f79e931 (patch) | |
| tree | 2dbbdc5367458fd752c1d1a1e9934635cd547db9 /src/main.c | |
| parent | e4fae251d3ce2697a91f02bbaad6b38dbafea593 (diff) | |
Fix memory error
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); } |
