diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-09-18 02:28:29 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-09-18 15:09:46 +0300 |
commit | 1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d (patch) | |
tree | 5510b76d5129831f9be4335ad9c91b595cb3d18e /libcli/util | |
parent | c3489a7918758848953f00cee6a36519cd059daf (diff) | |
download | samba-1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d.tar.gz samba-1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d.tar.bz2 samba-1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d.zip |
werror: Add W_ERROR_HAVE_NO_MEMORY_AND_FREE() macro
Diffstat (limited to 'libcli/util')
-rw-r--r-- | libcli/util/werror.h | 7 |
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;\ |