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

coverity fixes

This commit is contained in:
Alasdair Kergon 2006-05-10 16:23:41 +00:00
parent 45dca55fc8
commit b8d32a0d33
3 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.06 -
=============================
Fix leaks in error paths found by coverity.
Increase dmsetup line buffer to 4k.
Version 1.02.05 - 19 Apr 2006

View File

@ -101,8 +101,10 @@ struct dm_task *dm_task_create(int type)
return NULL;
}
if (!dm_check_version())
if (!dm_check_version()) {
dm_free(dmt);
return NULL;
}
memset(dmt, 0, sizeof(*dmt));

View File

@ -23,7 +23,7 @@
static int _create_dir_recursive(const char *dir)
{
char *orig, *s;
int rc;
int rc, r = 0;
log_verbose("Creating directory \"%s\"", dir);
/* Create parent directories */
@ -35,22 +35,24 @@ static int _create_dir_recursive(const char *dir)
if (rc < 0 && errno != EEXIST) {
log_error("%s: mkdir failed: %s", orig,
strerror(errno));
dm_free(orig);
return 0;
goto out;
}
}
*s++ = '/';
}
dm_free(orig);
/* Create final directory */
rc = mkdir(dir, 0777);
if (rc < 0 && errno != EEXIST) {
log_error("%s: mkdir failed: %s", orig,
strerror(errno));
return 0;
goto out;
}
return 1;
r = 1;
out:
dm_free(orig);
return r;
}
int create_dir(const char *dir)