#include "talloc.h"
#include <string.h>
#include <stdint.h>
+#include <errno.h>
/* use this to force every realloc to change the pointer, to stress test
code that might not cope */
*/
int talloc_free(void *ptr)
{
- return _talloc_free(ptr);
+ int saved_errno = errno, ret;
+ ret = _talloc_free(ptr);
+ if (ret == 0)
+ errno = saved_errno;
+ return ret;
}