From: Volker Lendecke Date: Fri, 9 Feb 2024 12:02:25 +0000 (+0100) Subject: smbd: Simplify smbXsrv_open_purge_replay_cache() X-Git-Tag: tdb-1.4.11~895 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5596cf4a6aa1c1025867fcad75485c87d8efd7f;p=thirdparty%2Fsamba.git smbd: Simplify smbXsrv_open_purge_replay_cache() GUID_buf_string is supposed to never fail except if the guid passed in is NULL. Our only current caller already checks that. dbwrap_purge_bystring() could actually fail, so put the result into a variable for the debugger. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c index ed2cf6f8a9f..31cbef29bd5 100644 --- a/source3/smbd/smbXsrv_open.c +++ b/source3/smbd/smbXsrv_open.c @@ -660,21 +660,16 @@ NTSTATUS smbXsrv_open_purge_replay_cache(struct smbXsrv_client *client, const struct GUID *create_guid) { struct GUID_txt_buf buf; - char *guid_string; - struct db_context *db; + NTSTATUS status; if (client->open_table == NULL) { return NT_STATUS_OK; } - db = client->open_table->local.replay_cache_db_ctx; - - guid_string = GUID_buf_string(create_guid, &buf); - if (guid_string == NULL) { - return NT_STATUS_INVALID_PARAMETER; - } - - return dbwrap_purge_bystring(db, guid_string); + status = dbwrap_purge_bystring( + client->open_table->local.replay_cache_db_ctx, + GUID_buf_string(create_guid, &buf)); + return status; } static NTSTATUS smbXsrv_open_clear_replay_cache(struct smbXsrv_open *op)