diff options
author | Jeremy Allison <jra@samba.org> | 2007-09-08 04:45:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:34 -0500 |
commit | fc213876d50909bbd8401794822aaa8a80ec4100 (patch) | |
tree | 30a26ef7492a17241c9b925d4579da0451667827 /source3 | |
parent | 62e3caf0feb396b65923ef849dab3143effcf787 (diff) | |
download | samba-fc213876d50909bbd8401794822aaa8a80ec4100.tar.gz samba-fc213876d50909bbd8401794822aaa8a80ec4100.tar.bz2 samba-fc213876d50909bbd8401794822aaa8a80ec4100.zip |
r25019: Fix coverity bug #105, run #332. Use of uninitialized variable.
Jeremy.
(This used to be commit a58de8cee51c1396a2607ee743c92d58d7703547)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_sam.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 3cc838e71b..056bd6a0cc 100644 --- a/source3/utils/net_sam.c +++ b/source3/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; } |