git.samba.org
/
abartlet
/
samba.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c3489a7
)
werror: Add W_ERROR_HAVE_NO_MEMORY_AND_FREE() macro
author
Kamen Mazdrashki
<kamenim@samba.org>
Fri, 17 Sep 2010 23:28:29 +0000
(
02:28
+0300)
committer
Kamen Mazdrashki
<kamenim@samba.org>
Sat, 18 Sep 2010 12:09:46 +0000
(15:09 +0300)
libcli/util/werror.h
patch
|
blob
|
history
diff --git
a/libcli/util/werror.h
b/libcli/util/werror.h
index 3b717d225970b0d8d260dd48ea14306fbc3f82c8..d89cd9c087bb1a63cb3e276d1b4da10c31378ba6 100644
(file)
--- a/
libcli/util/werror.h
+++ b/
libcli/util/werror.h
@@
-48,6
+48,13
@@
typedef uint32_t WERROR;
}\
} while (0)
}\
} 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;\
#define W_ERROR_IS_OK_RETURN(x) do { \
if (W_ERROR_IS_OK(x)) {\
return x;\