Expr filtering: fixed a few bugs.

This commit is contained in:
antirez 2025-02-20 20:44:57 +01:00
parent 097f310797
commit 2d1642504d
1 changed files with 2 additions and 2 deletions

4
vset.c
View File

@ -207,7 +207,7 @@ int vectorSetInsert(struct vsetObject *o, float *vec, int8_t *qvec, float qrange
if (attrib != NULL) o->numattribs++; if (attrib != NULL) o->numattribs++;
RedisModule_DictSet(o->dict,val,node); RedisModule_DictSet(o->dict,val,node);
RedisModule_RetainString(NULL,val); RedisModule_RetainString(NULL,val);
if (attrib) RedisModule_RetainString(NULL,val); if (attrib) RedisModule_RetainString(NULL,attrib);
return 1; return 1;
} }
@ -358,7 +358,7 @@ int VADD_CASReply(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
// Then: insert the node in the HNSW data structure. // Then: insert the node in the HNSW data structure.
hnswNode *newnode; hnswNode *newnode;
if ((newnode = hnsw_try_commit_insert(vset->hnsw, ic)) == NULL) { if ((newnode = hnsw_try_commit_insert(vset->hnsw, ic)) == NULL) {
newnode = hnsw_insert(vset->hnsw, vec, NULL, 0, 0, val, ef); newnode = hnsw_insert(vset->hnsw, vec, NULL, 0, 0, nv, ef);
} }
RedisModule_DictSet(vset->dict,val,newnode); RedisModule_DictSet(vset->dict,val,newnode);
val = NULL; // Don't free it later. val = NULL; // Don't free it later.