summaryrefslogtreecommitdiff
path: root/src/shared/fileio.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/shared/fileio.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/shared/fileio.c')
-rw-r--r--src/shared/fileio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/shared/fileio.c b/src/shared/fileio.c
index 0d3f2e90c7..d5915673d6 100644
--- a/src/shared/fileio.c
+++ b/src/shared/fileio.c
@@ -614,11 +614,9 @@ static int load_env_file_push(const char *filename, unsigned line,
if (!p)
return -ENOMEM;
- r = strv_push(m, p);
- if (r < 0) {
- free(p);
+ r = strv_consume(m, p);
+ if (r < 0)
return r;
- }
free(value);
return 0;