1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-26 14:04:15 +03:00

Set to a defined value vars used after error path

Static analyzer noticed this vars are used even when error is reported
back thus their state is undefined - set to 0 for this case.
This commit is contained in:
Zdenek Kabelac 2012-01-25 22:20:11 +00:00
parent baffb459d8
commit a1f42a8e88
2 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,7 @@ int do_pre_command(struct local_client *client)
unsigned char lock_cmd;
unsigned char lock_flags;
char *args = header->node + strlen(header->node) + 1;
int lockid;
int lockid = 0;
int status = 0;
char *lockname;

View File

@ -81,6 +81,7 @@ static int _check_device(struct cmd_context *cmd, struct device *dev)
}
if (!dev_get_size(dev, &size)) {
log_error("Couldn't get size of \"%s\"", dev_name(dev));
size = 0;
}
_print(cmd, dev, size, NULL);
_count(dev, &disks_found, &parts_found);