cdb_bucket = cdb_fetch(CDB_FULLTEXT, &tok, sizeof(int));
if (cdb_bucket != NULL) {
ftc_num_msgs[tok] = cdb_bucket->len / sizeof(long);
- ftc_msgs[tok] = (long *)cdb_bucket->ptr;
- cdb_bucket->ptr = NULL; // (this needs attention if we move to LMDB)
+ ftc_msgs[tok] = malloc(cdb_bucket->len);
+ memcpy(ftc_msgs[tok], cdb_bucket->ptr, cdb_bucket->len);
cdb_free(cdb_bucket);
}
else {
}
}
-
if (op == 1) { // add to index
++ftc_num_msgs[tok];
ftc_msgs[tok] = realloc(ftc_msgs[tok], ftc_num_msgs[tok]*sizeof(long));
cdb_bucket = cdb_fetch(CDB_FULLTEXT, &tok, sizeof(int));
if (cdb_bucket != NULL) {
ftc_num_msgs[tok] = cdb_bucket->len / sizeof(long);
- ftc_msgs[tok] = (long *)cdb_bucket->ptr;
- cdb_bucket->ptr = NULL; // (this needs attention if we move to LMDB)
+ ftc_msgs[tok] = (long *) malloc(cdb_bucket->len);
+ memcpy(ftc_msgs[tok], cdb_bucket->ptr, cdb_bucket->len);
cdb_free(cdb_bucket);
}
else {