summaryrefslogtreecommitdiff
path: root/src/core/locale-setup.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-04 09:20:51 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-04 10:04:50 -0500
commit6e18964d3a365567954fe10ddcfad74babdc427c (patch)
treea1e62c233e0cac0224623049e6fb98b8e450d0ac /src/core/locale-setup.c
parente062dec5ae1a443d47885537af85d328c83c67db (diff)
Introduce strv_consume which takes ownership
This mirrors set_consume and makes the common use a bit nicer.
Diffstat (limited to 'src/core/locale-setup.c')
-rw-r--r--src/core/locale-setup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
index 276deb9dc1..7a4103504f 100644
--- a/src/core/locale-setup.c
+++ b/src/core/locale-setup.c
@@ -133,8 +133,7 @@ int locale_setup(char ***environment) {
goto finish;
}
- if (strv_push(&add, s) < 0) {
- free(s);
+ if (strv_consume(&add, s) < 0) {
r = -ENOMEM;
goto finish;
}