summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-01-31 14:01:53 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-01-31 14:08:14 -0500
commit81a6ac6cf6622b4938fe18b55ebafbe8b5bbd29e (patch)
tree23dca7b10e6a79f293347cd6374abfff6a514cf4
parentdb284505c830560bf75853a752967e0c1106b506 (diff)
cryptsetup: do not return uninitialized value on error
CID #1368416.
-rw-r--r--src/cryptsetup/cryptsetup.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index cefd1b85df..91c653312a 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -594,7 +594,7 @@ static int help(void) {
int main(int argc, char *argv[]) {
struct crypt_device *cd = NULL;
- int r;
+ int r = -EINVAL;
if (argc <= 1) {
r = help();
@@ -603,7 +603,6 @@ int main(int argc, char *argv[]) {
if (argc < 3) {
log_error("This program requires at least two arguments.");
- r = -EINVAL;
goto finish;
}
@@ -750,7 +749,6 @@ int main(int argc, char *argv[]) {
} else {
log_error("Unknown verb %s.", argv[1]);
- r = -EINVAL;
goto finish;
}