git.samba.org
/
sahlberg
/
ctdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0eb1d0a
)
talloc: save errno over talloc_free
author
Rusty Russell
<rusty@rustcorp.com.au>
Mon, 7 Dec 2009 12:35:58 +0000
(23:05 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Mon, 7 Dec 2009 12:35:58 +0000
(23:05 +1030)
As we start to use errno more, it's a huge pain if talloc_free() can blatt
it (esp. destructors).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/talloc/talloc.c
patch
|
blob
|
history
diff --git
a/lib/talloc/talloc.c
b/lib/talloc/talloc.c
index b805c9725cd361213fe345d535b35510f473c601..8e11a1121829d2f05b8e77072e78bec54c9b0f3c 100644
(file)
--- a/
lib/talloc/talloc.c
+++ b/
lib/talloc/talloc.c
@@
-746,7
+746,12
@@
void *talloc_named_const(const void *context, size_t size, const char *name)
*/
int talloc_free(void *ptr)
{
- return _talloc_free(ptr);
+ int ret, saved_errno;
+
+ saved_errno = errno;
+ ret = _talloc_free(ptr);
+ errno = saved_errno;
+ return ret;
}