[Devel] potential memory leak in sl module
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Fri Jan 12 11:00:20 CET 2007
Hi Andrew,
you are right! thanks for pointing it out and fixing it - I applied the
fix on the CVS both devel and stable 1.1.0.
Thanks and regards,
Bogdan
Andrew Newton wrote:
> All,
>
> We believe we may have stumbled upon a possible memory leak in the sl
> module. We observed the bug in SER 0.8.14, and started looking at
> newer code in both SER and OpenSER to see if it had been fixed.
> Though the code has changed in OpenSER, it looks like the bug still
> exists.
>
> The potential leak is in sl_funcs.c, around line 217 (going off the
> current CVS HEAD).
>
> 214 ret = msg_send( msg->rcv.bind_address, msg->rcv.proto, &to,
> 215 msg->rcv.proto_reserved1, buf.s, buf.len);
> 216 mhomed=backup_mhomed;
> 217 if (ret<0)
> 218 goto error;
> 219
> 220 *(sl_timeout) = get_ticks() + SL_RPL_WAIT_TIME;
> 221 pkg_free(buf.s);
>
> Line 217 checks the output of the msg_send on line 214. If there is
> an error, it bypasses the freeing of buf.s on line 221. A possible
> fix might be to move line 221 to 216.
>
> Can anybody confirm this analysis?
>
> -andy
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>
More information about the Devel
mailing list