[SSSD] [PATCH] DP: Remove processed callbacks

Stephen Gallagher sgallagh at redhat.com
Fri Dec 16 19:12:36 UTC 2011


On Fri, 2011-12-16 at 10:31 +0100, Jakub Hrozek wrote:
> I noticed that sss_dp_get_account_int_done() would free sdp_req but then
> the callback destructor would dereference sdp_req as well. When the
> destructor is called, sdp_req is already gone.
> 
> It looks that the callback is not needed after it has called the request
> it links to so I think we can just free it and let the destructor
> remove it from the list.

It took me a while to puzzle out what the problem was here. The issue is
that the sdp_req is always freed just after the callbacks with the
results are sent back. However, the callback contexts are not allocated
beneath the sdp_req (because they need to be cancellable if the client
disconnects). So what would happen is that they would hang around until
the client eventually freed them, which would always happen *after* the
sdp_req had been freed.

This has been working only because we were lucky and the memory for
sdp_req was not being reclaimed.

Ack (and good catch!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20111216/134b8e93/attachment.sig>


More information about the sssd-devel mailing list