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/systemctl/systemctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/systemctl') diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index c2b1749def..b94f7f7958 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1843,9 +1843,8 @@ static int start_unit_one( if (!p) return log_oom(); - r = set_put(s, p); + r = set_consume(s, p); if (r < 0) { - free(p); log_error("Failed to add path to set."); return r; } -- cgit v1.2.3-54-g00ecf