Add set_consume which always takes ownership
Freeing in error path is the common pattern with set_put().
This commit is contained in:
@@ -119,7 +119,7 @@ static void test_struct(void) {
|
||||
assert_se(r >= 0);
|
||||
|
||||
if (i % 4 == 0) {
|
||||
r = set_put(s, t);
|
||||
r = set_consume(s, t);
|
||||
assert_se(r >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user