diff options
author | Sami Kerola | 2016-04-03 18:34:53 +0200 |
---|---|---|
committer | Sami Kerola | 2016-04-19 22:27:54 +0200 |
commit | ac943a662d67196f0087965ee1513f878160e2af (patch) | |
tree | e52aa63fbfe6ac5c047c24cba783bc5eae68b394 /libmount/src | |
parent | build-sys: test functions does not return void (diff) | |
download | kernel-qcow2-util-linux-ac943a662d67196f0087965ee1513f878160e2af.tar.gz kernel-qcow2-util-linux-ac943a662d67196f0087965ee1513f878160e2af.tar.xz kernel-qcow2-util-linux-ac943a662d67196f0087965ee1513f878160e2af.zip |
libmount: fix memory leak
Found with scan-build.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libmount/src')
-rw-r--r-- | libmount/src/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 0fcc1d070..8b80609e9 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -1107,7 +1107,7 @@ char *mnt_get_kernel_cmdline_option(const char *name) int mnt_guess_system_root(dev_t devno, struct libmnt_cache *cache, char **path) { char buf[PATH_MAX]; - char *dev = NULL, *spec; + char *dev = NULL, *spec = NULL; unsigned int x, y; int allocated = 0; @@ -1169,8 +1169,8 @@ int mnt_guess_system_root(dev_t devno, struct libmnt_cache *cache, char **path) if (dev && !cache) allocated = 1; } - free(spec); done: + free(spec); if (dev) { *path = allocated ? dev : strdup(dev); if (!path) |