mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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:
parent
c3b292a4a9
commit
5a4676fea9
@ -115,6 +115,7 @@ struct device *dev_create_file(const char *filename, struct device *dev,
|
|||||||
}
|
}
|
||||||
if (!(alias->str = _strdup(filename))) {
|
if (!(alias->str = _strdup(filename))) {
|
||||||
log_error("filename strdup failed");
|
log_error("filename strdup failed");
|
||||||
|
_free(dev);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user