talloc: let talloc_steal() only generate a warning if it's used with references
authorStefan Metzmacher <metze@samba.org>
Wed, 29 Jul 2009 19:41:34 +0000 (21:41 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Aug 2009 07:58:20 +0000 (09:58 +0200)
We have to many callers, which rely on that talloc_steal() never fails.

metze

lib/talloc/talloc.c

index a0065bccabb3f3b3980458a7c5ae95c1a6cf8a6a..64037b52cfd9b81b3376f991de011bfd781b00a0 100644 (file)
@@ -688,14 +688,13 @@ void *_talloc_steal_loc(const void *new_ctx, const void *ptr, const char *locati
        if (unlikely(tc->refs != NULL) && talloc_parent(ptr) != new_ctx) {
                struct talloc_reference_handle *h;
 #if DEVELOPER
-               fprintf(stderr, "ERROR: talloc_steal with references at %s\n", location);
+               fprintf(stderr, "WARNING: talloc_steal with references at %s\n", location);
 #endif
                for (h=tc->refs; h; h=h->next) {
 #if DEVELOPER
                        fprintf(stderr, "\treference at %s\n", h->location);
 #endif
                }
-               return NULL;
        }
        
        return _talloc_steal_internal(new_ctx, ptr);