]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Save lines with a direct variable initialization
authorVolker Lendecke <vl@samba.org>
Mon, 10 Feb 2025 08:54:52 +0000 (09:54 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 5 Mar 2025 17:41:34 +0000 (17:41 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/smb/smbXcli_base.c

index 1e8ccb785def32ac02b460c589304f7b9a340637..f61015f84c178446fa2141d08bc0ab7e2f5d0d2a 100644 (file)
@@ -1149,18 +1149,14 @@ bool smbXcli_req_set_pending(struct tevent_req *req)
        struct smbXcli_req_state *state =
                tevent_req_data(req,
                struct smbXcli_req_state);
-       struct smbXcli_conn *conn;
-       struct tevent_req **pending;
-       size_t num_pending;
-
-       conn = state->conn;
+       struct smbXcli_conn *conn = state->conn;
+       struct tevent_req **pending = NULL;
+       size_t num_pending = talloc_array_length(conn->pending);
 
        if (!smbXcli_conn_is_connected(conn)) {
                return false;
        }
 
-       num_pending = talloc_array_length(conn->pending);
-
        pending = talloc_realloc(conn, conn->pending, struct tevent_req *,
                                 num_pending+1);
        if (pending == NULL) {