1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +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 425862fb95
commit b23975ee28
2 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.66 - 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 systemd file descriptor handover in dmeventd.
Add support for new oom killer adjustment interface (oom_score_adj). Add support for new oom killer adjustment interface (oom_score_adj).
Add systemd unit files for dmeventd. 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); log_verbose("Creating directory \"%s\"", dir);
/* Create parent directories */ /* Create parent directories */
orig = s = dm_strdup(dir); orig = s = dm_strdup(dir);
if (!s) {
log_error("Failed to duplicate directory name.");
return 0;
}
while ((s = strchr(s, '/')) != NULL) { while ((s = strchr(s, '/')) != NULL) {
*s = '\0'; *s = '\0';
if (*orig) { if (*orig) {