From 4660412a7ff666e8e405ce8a4b4bc4a6dc489bfa Mon Sep 17 00:00:00 2001 From: Ping Xie Date: Wed, 22 May 2024 23:17:39 -0700 Subject: [PATCH] Reinitialize pointer 'p' after ziplistDeleteRange to fix head deletion bug. Signed-off-by: Ping Xie --- src/unit/test_ziplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unit/test_ziplist.c b/src/unit/test_ziplist.c index 52e225cdc5..20c7c358db 100644 --- a/src/unit/test_ziplist.c +++ b/src/unit/test_ziplist.c @@ -360,7 +360,7 @@ int test_ziplistDeleteInclusiveRange0To0(int argc, char **argv, int flags) { int orig_len = ziplistLen(zl); zl = ziplistDeleteRange(zl, 0, 1); - + p = ziplistIndex(zl, 0); TEST_ASSERT(ziplistCompare(p, (unsigned char *)"foo", 3)); int new_len = ziplistLen(zl); TEST_ASSERT(orig_len - 1 == new_len);