]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: Move NULL check before messaging_dgm_out_rearm_idle_timer()
authorAndreas Schneider <asn@samba.org>
Mon, 9 Dec 2019 09:47:46 +0000 (10:47 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Dec 2019 00:30:29 +0000 (00:30 +0000)
We dereference out in messaging_dgm_out_rearm_idle_timer().

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/lib/messages_dgm.c

index 11cb6969e733a1bdaac6a54d209dd02bbe1cac92..661e032b908e022ad8dd215eb00079daf355478e 100644 (file)
@@ -322,7 +322,6 @@ static int messaging_dgm_out_get(struct messaging_dgm_context *ctx, pid_t pid,
                }
        }
 
-       messaging_dgm_out_rearm_idle_timer(out);
        /*
         * shouldn't be possible, should be set if messaging_dgm_out_create
         * succeeded. This check is to satisfy static checker
@@ -330,6 +329,7 @@ static int messaging_dgm_out_get(struct messaging_dgm_context *ctx, pid_t pid,
        if (out == NULL) {
                return EINVAL;
        }
+       messaging_dgm_out_rearm_idle_timer(out);
 
        *pout = out;
        return 0;