mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
talloc: let talloc_steal() only generate a warning if it's used with references
We have to many callers, which rely on that talloc_steal() never fails. metze
This commit is contained in:
parent
84810d7182
commit
ac8aeec824
@ -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) {
|
if (unlikely(tc->refs != NULL) && talloc_parent(ptr) != new_ctx) {
|
||||||
struct talloc_reference_handle *h;
|
struct talloc_reference_handle *h;
|
||||||
#if DEVELOPER
|
#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
|
#endif
|
||||||
for (h=tc->refs; h; h=h->next) {
|
for (h=tc->refs; h; h=h->next) {
|
||||||
#if DEVELOPER
|
#if DEVELOPER
|
||||||
fprintf(stderr, "\treference at %s\n", h->location);
|
fprintf(stderr, "\treference at %s\n", h->location);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _talloc_steal_internal(new_ctx, ptr);
|
return _talloc_steal_internal(new_ctx, ptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user