s3 torture: Prevent smbcli segfault when running smbtorture3 against an smbd with...
authorTim Prouty <tprouty@samba.org>
Mon, 4 Jan 2010 20:57:34 +0000 (12:57 -0800)
committerTim Prouty <tprouty@samba.org>
Thu, 7 Jan 2010 23:32:27 +0000 (15:32 -0800)
source3/libsmb/cliconnect.c

index 31216b82409f3ec8d5617a337c86be8f6accdeaa..fa79ebcea362606919f4dc409af0061758fdaa2d 100644 (file)
@@ -1573,6 +1573,8 @@ struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
        char *tmp = NULL;
        uint8_t *bytes;
 
        char *tmp = NULL;
        uint8_t *bytes;
 
+       *psmbreq = NULL;
+
        req = tevent_req_create(mem_ctx, &state, struct cli_tcon_andx_state);
        if (req == NULL) {
                return NULL;
        req = tevent_req_create(mem_ctx, &state, struct cli_tcon_andx_state);
        if (req == NULL) {
                return NULL;
@@ -1708,6 +1710,9 @@ struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
        if (req == NULL) {
                return NULL;
        }
        if (req == NULL) {
                return NULL;
        }
+       if (subreq == NULL) {
+               return req;
+       }
        status = cli_smb_req_send(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);
        status = cli_smb_req_send(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);