projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d2bd84b
)
Fixed memory leak that occurred if sorting failed.
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 12 Aug 2008 08:56:10 +0000
(10:56 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 12 Aug 2008 08:56:10 +0000
(10:56 +0200)
index/zsets.c
patch
|
blob
|
history
diff --git
a/index/zsets.c
b/index/zsets.c
index
9054cfe
..
ce615ff
100644
(file)
--- a/
index/zsets.c
+++ b/
index/zsets.c
@@
-907,8
+907,10
@@
ZEBRA_RES resultSetSortSingle(ZebraHandle zh, NMEM nmem,
Z_SortKey *sk;
ZEBRA_RES res;
Z_SortKey *sk;
ZEBRA_RES res;
- sort_criteria[i].ord = (int *)xmalloc(sizeof(int)*numbases);
- sort_criteria[i].numerical = (int *)xmalloc(sizeof(int)*numbases);
+ sort_criteria[i].ord = (int *)
+ nmem_malloc(nmem, sizeof(int)*numbases);
+ sort_criteria[i].numerical = (int *)
+ nmem_malloc(nmem, sizeof(int)*numbases);
// initialize ord and numerical for each database
for (ib = 0; ib < numbases; ib++)
// initialize ord and numerical for each database
for (ib = 0; ib < numbases; ib++)
@@
-1038,9
+1040,6
@@
ZEBRA_RES resultSetSortSingle(ZebraHandle zh, NMEM nmem,
{
xfree(cmp_buf[i]);
xfree(tmp_cmp_buf[i]);
{
xfree(cmp_buf[i]);
xfree(tmp_cmp_buf[i]);
- // and the criteria
- xfree(sort_criteria[i].ord);
- xfree(sort_criteria[i].numerical);
}
yaz_log(log_level_sort, ZINT_FORMAT " keys, " ZINT_FORMAT " sysnos, sort",
}
yaz_log(log_level_sort, ZINT_FORMAT " keys, " ZINT_FORMAT " sysnos, sort",