realloc in rlm_pam

Nicolas Baradakis nbk at sitadelle.com
Wed Dec 21 12:58:53 CET 2005


Wolfgang Rosenauer wrote:

> just found this one in 1.0.x and 1.1 branch code in rlm_pam.c:
>
> #define GET_MEM if (reply) realloc(reply, size); else reply =
> rad_malloc(size); \
>
> This is changed on trunk already but it should be changed on 1.0 and 1.1
> branches as well, because it really seems to fail if the statement is
> true but realloc() has to move the memory to another location. reply is
> not updated in this case. So the easiest fix would be:
>
> #define GET_MEM if (reply) reply = realloc(reply, size); else reply =
> rad_malloc(size); \

Thanks for the report. The fix above is trivial, so I've added it to
the branch 1.1.

As Alan said, we'd like to close off any change to 1.1.0, that's why
I didn't pull the changes from CVS head.

-- 
Nicolas Baradakis




More information about the Freeradius-Devel mailing list