1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Add missing check for allocation failure

Static analyzer discovered missing check.
This commit is contained in:
Zdenek Kabelac 2011-08-04 17:56:11 +00:00
parent b43795c364
commit 67d0232816
2 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.66 -
===============================
Add missing check for allocation failure _create_dir_recursive().
Add support for systemd file descriptor handover in dmeventd.
Add support for new oom killer adjustment interface (oom_score_adj).
Add systemd unit files for dmeventd.

View File

@ -27,6 +27,11 @@ static int _create_dir_recursive(const char *dir)
log_verbose("Creating directory \"%s\"", dir);
/* Create parent directories */
orig = s = dm_strdup(dir);
if (!s) {
log_error("Failed to duplicate directory name.");
return 0;
}
while ((s = strchr(s, '/')) != NULL) {
*s = '\0';
if (*orig) {