1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2014-12-06 23:55:25 +01:00
parent c3b292a4a9
commit 5a4676fea9

View File

@ -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;
}
}