[SSSD] [PATCH] Allow arbitrary-length PAM messages
Simo Sorce
ssorce at redhat.com
Tue Mar 23 20:51:22 UTC 2010
On Tue, 23 Mar 2010 16:38:57 -0400
Stephen Gallagher <sgallagh at redhat.com> wrote:
> + tempbuf = talloc_realloc(state, state->buf, uint8_t,
> + state->len + size);
> + if(!tempbuf) {
> + tevent_req_error(req, ENOMEM);
> return;
> }
> + state->buf = talloc_steal(state, tempbuf);
Why the use of tempbuf ?
you can simply do
state->buf = talloc_realloc(state, state->buf, ...
if state->buf is null you abort the whole operation anyway.
The talloc_steal is also useless given that talloc_realloc doesn't
change the parent.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
More information about the sssd-devel
mailing list