if (hwe->revision)
FREE(hwe->revision);
- if (hwe->selector)
- FREE(hwe->selector);
-
if (hwe->getuid)
FREE(hwe->getuid);
if (hwe->hwhandler)
FREE(hwe->hwhandler);
+ if (hwe->selector)
+ FREE(hwe->selector);
+
+ if (hwe->checker_name)
+ FREE(hwe->checker_name);
+
+ if (hwe->prio_name)
+ FREE(hwe->prio_name);
+
if (hwe->bl_product)
FREE(hwe->bl_product);
if (conf->checker_name)
FREE(conf->checker_name);
+ if (conf->prio_name)
+ FREE(conf->prio_name);
+
+ if (conf->checker_name)
+ FREE(conf->checker_name);
+
free_blacklist(conf->blist_devnode);
free_blacklist(conf->blist_wwid);
free_blacklist_device(conf->blist_device);
char block_path[FILE_NAME_SIZE];
struct stat statbuf;
+ memset(block_path, 0, FILE_NAME_SIZE);
if (sscanf(devt, "%u:%u", &major, &minor) != 2) {
condlog(0, "Invalid device number %s", devt);
return 1;
static int
snprint_progress (char * buff, size_t len, int cur, int total)
{
- int i = PROGRESS_LEN * cur / total;
- int j = PROGRESS_LEN - i;
char * c = buff;
char * end = buff + len;
- while (i-- > 0) {
- c += snprintf(c, len, "X");
- if ((len = (end - c)) <= 1) goto out;
- }
+ if (total > 0) {
+ int i = PROGRESS_LEN * cur / total;
+ int j = PROGRESS_LEN - i;
+
+ while (i-- > 0) {
+ c += snprintf(c, len, "X");
+ if ((len = (end - c)) <= 1) goto out;
+ }
- while (j-- > 0) {
- c += snprintf(c, len, ".");
- if ((len = (end - c)) <= 1) goto out;
+ while (j-- > 0) {
+ c += snprintf(c, len, ".");
+ if ((len = (end - c)) <= 1) goto out;
+ }
}
c += snprintf(c, len, " %i/%i", cur, total);
{
char buff[MAX_LINE_LEN * MAX_LINES] = {};
+ memset(&buff[0], 0, MAX_LINE_LEN * MAX_LINES);
snprint_multipath_topology(&buff[0], MAX_LINE_LEN * MAX_LINES,
mpp, verbosity);
printf("%s", buff);