summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcli/util/werror.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcli/util/werror.h b/libcli/util/werror.h
index 3b717d2259..d89cd9c087 100644
--- a/libcli/util/werror.h
+++ b/libcli/util/werror.h
@@ -48,6 +48,13 @@ typedef uint32_t WERROR;
}\
} while (0)
+#define W_ERROR_HAVE_NO_MEMORY_AND_FREE(x, ctx) do { \
+ if (!(x)) {\
+ talloc_free(ctx); \
+ return WERR_NOMEM;\
+ }\
+} while (0)
+
#define W_ERROR_IS_OK_RETURN(x) do { \
if (W_ERROR_IS_OK(x)) {\
return x;\