Commit 80e2890e76236b937ecc6645caf499355412ee60

Thomas de Grivel 2024-09-18T09:50:12

fix cow double free

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libkc3/cow.c b/libkc3/cow.c
index 9b6271b..e73aae3 100644
--- a/libkc3/cow.c
+++ b/libkc3/cow.c
@@ -291,7 +291,6 @@ sw cow_unref (s_cow *cow)
     assert(! "cow_unref: reference count = 0");
     return -1;
   }
-  if (! --cow->reference_count)
-    cow_clean(cow);
+  cow->reference_count--;
   return cow->reference_count;
 }