realloc in rlm_pam

Wolfgang Rosenauer stark at suse.de
Wed Dec 21 10:34:40 CET 2005


Hi,

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); \

(or to take the changes from trunk)


CU,

   Wolfgang

-- 
SUSE LINUX GmbH             -o)   Tel: +49-(0)911-740 53 0
Maxfeldstr. 5               /\\   Fax: +49-(0)911-740 53 679
90409 Nuernberg, Germany   _\_v   simply change to www.suse.com



More information about the Freeradius-Devel mailing list