embed: a failed batch alloc frees the vectors it already made
The remote branch allocates vec[0..n) first, then a texts[] array. When that calloc failed the function broke out with the vectors still held. Test: make check (all tests passed), tests/test_embed ok
This commit is contained in:
1 parent
3b0de63e06
commit
f7158d34d2
1 file changed
+2
@@ -1059,6 +1059,8 @@ catch_up(struct sp_embed_ctx *c)
|
||||
|
||||
if (texts == NULL) {
|
||||
sp_buf_puts(&err, "out of memory");
|
||||
/* the vectors are already allocated */
|
||||
vecs_free(vec, n);
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user