If the timeout has been set to zero, don't register an end time.
[idra/samba.git] / source3 / libsmb / async_smb.c
index 2f1f45c0a684dd6324401658b7783add00a14bf3..4518518a4328c5cc6062ef02b08fbee26e6093fc 100644 (file)
@@ -424,9 +424,11 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
        }
        state->iov_count = iov_count + 3;
 
-       endtime = timeval_current_ofs(0, cli->timeout * 1000);
-       if (!tevent_req_set_endtime(result, ev, endtime)) {
-               tevent_req_nomem(NULL, result);
+       if (cli->timeout) {
+               endtime = timeval_current_ofs(0, cli->timeout * 1000);
+               if (!tevent_req_set_endtime(result, ev, endtime)) {
+                       tevent_req_nomem(NULL, result);
+               }
        }
        return result;
 }