diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-22 23:12:15 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-24 00:25:04 -0400 |
commit | ef42202ac8ed27e7ff1fc90ef8bc2590046dff25 (patch) | |
tree | b1646eeb8ef5070337ae701ffb4abf0e398640ad /src/core/load-fragment.c | |
parent | c79bb9e4e2e5b96b2ae2c432bf8b0ff9674fce60 (diff) |
Add set_consume which always takes ownership
Freeing in error path is the common pattern with set_put().
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 0571d517b0..3d23372630 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -2095,11 +2095,9 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) { if (!id) return -ENOMEM; - r = set_put(names, id); - if (r < 0) { - free(id); + r = set_consume(names, id); + if (r < 0) return r; - } } } |