On (07/04/14 22:21), Sumit Bose wrote:
On Mon, Apr 07, 2014 at 09:20:50PM +0200, Lukas Slebodnik wrote:
> but there is no difference. You allocate debug_prg_name on NULL and then steal
> to another talloc context. (like in ldap_child)
Why do you have to steal it? Just allocate on NULL and free it in the
end.
1st:
Jakub suggested it in mail
https://lists.fedorahosted.org/pipermail/sssd-devel/2014-April/019002.html
2nd:
it is in ldap_child.
sh-4.2$ grep -B6 -n talloc_steal src/providers/ldap/ldap_child.c
478- main_ctx = talloc_new(NULL);
479- if (main_ctx == NULL) {
480- DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n");
481- talloc_free(discard_const(debug_prg_name));
482- goto fail;
483- }
484: talloc_steal(main_ctx, debug_prg_name);
LS