git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1d9960
)
added NT_STATUS_NOT_OK_RETURN_AND_FREE()
author
Andrew Tridgell
<tridge@samba.org>
Fri, 16 Oct 2009 06:04:19 +0000
(17:04 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Sat, 17 Oct 2009 02:01:02 +0000
(13:01 +1100)
Try to make it a bit easier to avoid leaks in common code
libcli/util/ntstatus.h
patch
|
blob
|
history
diff --git
a/libcli/util/ntstatus.h
b/libcli/util/ntstatus.h
index 1025f472104f2ba027a680e4191a9efaa20c5aed..88b4353c1d1c02439a3387df11ebdbe3a31aab08 100644
(file)
--- a/
libcli/util/ntstatus.h
+++ b/
libcli/util/ntstatus.h
@@
-674,6
+674,13
@@
extern bool ntstatus_check_dos_mapping;
}\
} while (0)
}\
} 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;\
#define NT_STATUS_IS_ERR_RETURN(x) do { \
if (NT_STATUS_IS_ERR(x)) {\
return x;\