From bc952b51f48905392cec5685853fbb44565057a8 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 20 May 2023 14:37:56 -0400 Subject: list: Return the removed item from SLIST_POP() --- src/xspawn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/xspawn.c') diff --git a/src/xspawn.c b/src/xspawn.c index 00fb76e..740e38e 100644 --- a/src/xspawn.c +++ b/src/xspawn.c @@ -49,9 +49,7 @@ int bfs_spawn_init(struct bfs_spawn *ctx) { int bfs_spawn_destroy(struct bfs_spawn *ctx) { while (ctx->head) { - struct bfs_spawn_action *action = ctx->head; - SLIST_POP(ctx); - free(action); + free(SLIST_POP(ctx)); } return 0; -- cgit v1.2.3