diff options
author | 2013-03-24 19:09:19 -0400 | |
---|---|---|
committer | 2013-04-05 19:58:53 -0400 | |
commit | c84a94883161073239c35d181e25823ff0454f68 (patch) | |
tree | 64c6fbf807493f3d878fa53113ba857116de7393 /src/shared/util.c | |
parent | Use initalization instead of explicit zeroing (diff) | |
download | systemd-c84a94883161073239c35d181e25823ff0454f68.tar.gz systemd-c84a94883161073239c35d181e25823ff0454f68.tar.bz2 systemd-c84a94883161073239c35d181e25823ff0454f68.zip |
Add _cleanup_globfree_
Fixes a memleak in error path in exec_context_load_environment.
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index 2f66597de..52867a177 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -4322,7 +4322,7 @@ int in_group(const char *name) { } int glob_exists(const char *path) { - glob_t g; + glob_t _cleanup_globfree_ g = {}; int r, k; assert(path); @@ -4339,8 +4339,6 @@ int glob_exists(const char *path) { else r = errno ? -errno : -EIO; - globfree(&g); - return r; } |