smbd: Simplify smbXsrv_open_clear_replay_cache()
authorVolker Lendecke <vl@samba.org>
Fri, 9 Feb 2024 12:05:28 +0000 (13:05 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 30 Apr 2024 22:44:32 +0000 (22:44 +0000)
GUID_buf_string() is designed to never fail

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smbXsrv_open.c

index 31cbef29bd5ff5883407ab56212253d17855994d..6fd64a028c952385569026c306e1c15aa9d5cb71 100644 (file)
@@ -676,7 +676,6 @@ static NTSTATUS smbXsrv_open_clear_replay_cache(struct smbXsrv_open *op)
 {
        struct GUID *create_guid;
        struct GUID_txt_buf buf;
-       char *guid_string;
        struct db_context *db;
        NTSTATUS status;
 
@@ -695,12 +694,7 @@ static NTSTATUS smbXsrv_open_clear_replay_cache(struct smbXsrv_open *op)
                return NT_STATUS_OK;
        }
 
-       guid_string = GUID_buf_string(create_guid, &buf);
-       if (guid_string == NULL) {
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       status = dbwrap_purge_bystring(db, guid_string);
+       status = dbwrap_purge_bystring(db, GUID_buf_string(create_guid, &buf));
 
        if (NT_STATUS_IS_OK(status)) {
                op->flags &= ~SMBXSRV_OPEN_HAVE_REPLAY_CACHE;