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:
lotherk committed 2026-11-23 13:02:37 +00:00
1 parent 3b0de63e06
commit f7158d34d2
1 file changed
+2
+2
View File
@@ -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;
}