summaryrefslogtreecommitdiff
path: root/source4/lib/talloc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/talloc')
-rw-r--r--source4/lib/talloc/talloc.c4
-rw-r--r--source4/lib/talloc/talloc.i7
2 files changed, 9 insertions, 2 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 4d72c0e871..f9aefcd6de 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -1246,12 +1246,12 @@ char *talloc_strndup_append_buffer(char *s, const char *a, size_t n)
#endif
char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
-{
+{
int len;
char *ret;
va_list ap2;
char c;
-
+
/* this call looks strange, but it makes it work on older solaris boxes */
va_copy(ap2, ap);
len = vsnprintf(&c, 1, fmt, ap2);
diff --git a/source4/lib/talloc/talloc.i b/source4/lib/talloc/talloc.i
index c35d5d2411..c852ae8f9f 100644
--- a/source4/lib/talloc/talloc.i
+++ b/source4/lib/talloc/talloc.i
@@ -22,3 +22,10 @@
%typemap(in, numinputs=0) TALLOC_CTX * {
$1 = NULL;
}
+
+%define %talloctype(TYPE)
+%nodefaultctor TYPE;
+%extend TYPE {
+ ~TYPE() { talloc_free($self); }
+}
+%enddef