summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-09-18 02:28:29 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-09-18 15:09:46 +0300
commit1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d (patch)
tree5510b76d5129831f9be4335ad9c91b595cb3d18e /libcli
parentc3489a7918758848953f00cee6a36519cd059daf (diff)
downloadsamba-1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d.tar.gz
werror: Add W_ERROR_HAVE_NO_MEMORY_AND_FREE() macro
Diffstat (limited to 'libcli')
-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 3b717d22597..d89cd9c087b 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;\