#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;
}
/*
append to a talloced string
*/
-char *talloc_append_string(const void *t, char *orig, const char *append)
+char *talloc_append_string(char *orig, const char *append)
{
char *ret;
size_t olen = strlen(orig);
alenz = strlen(append) + 1;
- ret = talloc_realloc(t, orig, char, olen + alenz);
+ ret = talloc_realloc(NULL, orig, char, olen + alenz);
if (!ret)
return NULL;