From ef42202ac8ed27e7ff1fc90ef8bc2590046dff25 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 22 Apr 2013 23:12:15 -0400 Subject: Add set_consume which always takes ownership Freeing in error path is the common pattern with set_put(). --- src/core/mount-setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/mount-setup.c') diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index 89adb0b4a3..b841f478c3 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -251,10 +251,9 @@ int mount_cgroup_controllers(char ***join_controllers) { continue; } - r = set_put(controllers, controller); + r = set_consume(controllers, controller); if (r < 0) { log_error("Failed to add controller to set."); - free(controller); goto finish; } } -- cgit v1.2.3-54-g00ecf