mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
talloc: save errno over talloc_free
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> (This used to be ctdb commit 76a0ca77feba14e1e1162c195ffbdf516e62aa4d)
This commit is contained in:
parent
066a791770
commit
949803528d
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user