summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-09-08 04:45:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:34 -0500
commita58de8cee51c1396a2607ee743c92d58d7703547 (patch)
treee8ad5223c78fafa9e6d42d979cc14eae3914e04e
parent2e0999c1df33c192fee5f739070a0e4c3d22dff8 (diff)
downloadsamba-a58de8cee51c1396a2607ee743c92d58d7703547.tar.gz
samba-a58de8cee51c1396a2607ee743c92d58d7703547.tar.xz
samba-a58de8cee51c1396a2607ee743c92d58d7703547.zip
r25019: Fix coverity bug #105, run #332. Use of uninitialized variable.
Jeremy.
-rw-r--r--source/utils/net_sam.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/utils/net_sam.c b/source/utils/net_sam.c
index 3cc838e71b8..056bd6a0ccf 100644
--- a/source/utils/net_sam.c
+++ b/source/utils/net_sam.c
@@ -362,7 +362,8 @@ static int net_sam_set(int argc, const char **argv)
static int net_sam_policy_set(int argc, const char **argv)
{
const char *account_policy = NULL;
- uint32 value, old_value;
+ uint32 value = 0;
+ uint32 old_value = 0;
int field;
char *endptr;
@@ -409,19 +410,20 @@ static int net_sam_policy_set(int argc, const char **argv)
if (!pdb_get_account_policy(field, &old_value)) {
d_fprintf(stderr, "Valid account policy, but unable to fetch "
"value!\n");
+ } else {
+ d_printf("Account policy \"%s\" value was: %d\n", account_policy,
+ old_value);
}
if (!pdb_set_account_policy(field, value)) {
d_fprintf(stderr, "Valid account policy, but unable to "
"set value!\n");
return -1;
+ } else {
+ d_printf("Account policy \"%s\" value is now: %d\n", account_policy,
+ value);
}
- d_printf("Account policy \"%s\" value was: %d\n", account_policy,
- old_value);
-
- d_printf("Account policy \"%s\" value is now: %d\n", account_policy,
- value);
return 0;
}