diff options
-rw-r--r-- | libcli/util/ntstatus.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h index 1025f47210..88b4353c1d 100644 --- a/libcli/util/ntstatus.h +++ b/libcli/util/ntstatus.h @@ -674,6 +674,13 @@ extern bool ntstatus_check_dos_mapping; }\ } while (0) +#define NT_STATUS_NOT_OK_RETURN_AND_FREE(x, ctx) do { \ + if (!NT_STATUS_IS_OK(x)) {\ + talloc_free(ctx); \ + return x;\ + }\ +} while (0) + #define NT_STATUS_IS_ERR_RETURN(x) do { \ if (NT_STATUS_IS_ERR(x)) {\ return x;\ |