summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2003-12-19 01:43:44 +0000
committerRichard Sharpe <sharpe@samba.org>2003-12-19 01:43:44 +0000
commita07d253fda667b748fdfd46de289171199878560 (patch)
treefdb5c229c81bfc18b2656c4014ce10d77117a6ea
parent682f20c9ca501cca0d60f838547917db7dd361d7 (diff)
downloadsamba-a07d253fda667b748fdfd46de289171199878560.tar.gz
samba-a07d253fda667b748fdfd46de289171199878560.tar.bz2
samba-a07d253fda667b748fdfd46de289171199878560.zip
A small fix to torture.c to cleanup the error handling and prevent crashes.
I really should clean up the comment as well. (This used to be commit 34351e457a0d9c494653179429fb71453d1d838e)
-rw-r--r--source3/torture/torture.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index bf3f0c6194..1708f334f3 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -2792,8 +2792,8 @@ static BOOL run_oplock3(int dummy)
*/
static BOOL run_deletetest(int dummy)
{
- struct cli_state *cli1;
- struct cli_state *cli2;
+ struct cli_state *cli1 = NULL;
+ struct cli_state *cli2 = NULL;
const char *fname = "\\delete.file";
int fnum1 = -1;
int fnum2 = -1;
@@ -3201,15 +3201,15 @@ static BOOL run_deletetest(int dummy)
* intialized, because these functions don't handle
* uninitialized connections. */
- cli_close(cli1, fnum1);
- cli_close(cli1, fnum2);
+ if (fnum1 != -1) cli_close(cli1, fnum1);
+ if (fnum2 != -1) cli_close(cli1, fnum2);
cli_setatr(cli1, fname, 0, 0);
cli_unlink(cli1, fname);
- if (!torture_close_connection(cli1)) {
+ if (cli1 && !torture_close_connection(cli1)) {
correct = False;
}
- if (!torture_close_connection(cli2)) {
+ if (cli2 && !torture_close_connection(cli2)) {
correct = False;
}
return correct;