diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2014-12-06 23:55:25 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-16 01:16:11 +0100 |
commit | 5a4676fea9808f348b9bbda46c03dce298eef6e5 (patch) | |
tree | 5e8eceb94eab09a7a2143778c5ab7387358120ea | |
parent | c3b292a4a9924d00da421d66d8281f8cd8efc3a9 (diff) | |
download | lvm2-5a4676fea9808f348b9bbda46c03dce298eef6e5.tar.gz |
cleanup: add _free on error path
Just like with failing allocation above also _free(dev).
TODO: rework this to always use mempool and drop unneeded
comlexity we have in this function.
-rw-r--r-- | lib/device/dev-cache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index b9d427190..185b3945f 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -115,6 +115,7 @@ struct device *dev_create_file(const char *filename, struct device *dev, } if (!(alias->str = _strdup(filename))) { log_error("filename strdup failed"); + _free(dev); return NULL; } } |