a talloc_realloc() to zero size needs to use an unambiguous free
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 06:36:10 +0000 (16:36 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 06:37:33 +0000 (16:37 +1000)
lib/talloc/talloc.c

index bf2fb1f72e9148c0a7c88dad0c3c2232b3d3b872..e68b6539dc602884b352572303e23aa22dc9a734 100644 (file)
@@ -1067,7 +1067,7 @@ void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *n
 
        /* size zero is equivalent to free() */
        if (unlikely(size == 0)) {
-               talloc_free(ptr);
+               talloc_unlink(context, ptr);
                return NULL;
        }