diff options
author | Stefan Metzmacher <metze@samba.org> | 2019-09-10 12:37:52 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-10 18:56:45 +0000 |
commit | 849e3842cd9a0000fb4393b6e770945b8d4d1dc2 (patch) | |
tree | d266ddffc1c702a27d7a9710e1aee7eaecdfbd1b /source4/torture | |
parent | 8270b8c0b2141e3db1cba16b72d152686efe824f (diff) | |
download | samba-849e3842cd9a0000fb4393b6e770945b8d4d1dc2.tar.gz |
s4:torture/smb2: try to fix a RESOURCE_LEAK in smb2.samba3misc.localposixlock1
CID 1453656: (RESOURCE_LEAK)
Handle variable "fd" going out of scope leaks the handle.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 10 18:56:45 UTC 2019 on sn-devel-184
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/samba3misc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/torture/smb2/samba3misc.c b/source4/torture/smb2/samba3misc.c index a5fe6c1bbea..cf4d9bbe18f 100644 --- a/source4/torture/smb2/samba3misc.c +++ b/source4/torture/smb2/samba3misc.c @@ -127,7 +127,8 @@ static bool torture_samba3_localposixlock1(struct torture_context *tctx, rc = fcntl(fd, F_SETLK, &posix_lock); if (rc == -1) { torture_warning(tctx, "fcntl failed: %s\n", strerror(errno)); - torture_assert(tctx, rc != -1, "fcntl lock\n"); + torture_assert_goto(tctx, rc != -1, ret, done, + "fcntl lock\n"); } el[0].offset = 0; @@ -147,13 +148,13 @@ static bool torture_samba3_localposixlock1(struct torture_context *tctx, torture_comment(tctx, " remote async blocking lock\n"); el[0].flags = SMB2_LOCK_FLAG_EXCLUSIVE; req = smb2_lock_send(tree, &lck); - torture_assert(tctx, req != NULL, "smb2_lock_send()\n"); + torture_assert_goto(tctx, req != NULL, ret, done, "smb2_lock_send()\n"); te = tevent_add_timer(tctx->ev, tctx, timeval_current_ofs(5, 0), torture_smb2_tree_disconnect_timer, tree); - torture_assert(tctx, te != NULL, "tevent_add_timer\n"); + torture_assert_goto(tctx, te != NULL, ret, done, "tevent_add_timer\n"); torture_comment(tctx, " remote wait for STATUS_PENDING\n"); WAIT_FOR_ASYNC_RESPONSE(req); |