diff -r 952c2df7e7ac -r 477404eb380e src/string.c --- a/src/string.c Sun Dec 29 11:29:17 2019 +0100 +++ b/src/string.c Sun Dec 29 11:30:39 2019 +0100 @@ -776,6 +776,9 @@ } while (curbuf); memcpy(destptr, str.ptr+srcidx, str.length-srcidx); + /* Free index buffer */ + scstrrepl_free_ibuf(firstbuf); + return result; }