Menu

#90 SLPBroadcast/MulticastSend socket file desriptor leak

open
nobody
5
2012-11-14
2007-02-02
Anonymous
No

If an error occurs in the main for loop in SLPBroadcastSend() and SLPMulticastSend() after the socket is created, socks->sock_count will NOT get incremented since the error causes a premature exit from the loop (and function).

The result is that sock_count will be incorrect (one less than it should be) and the last opened socket will not get closed in SLPXcastSocketsClose().

Suggest replacing with while loop and increment socks->sock_count immediately after the socket is created.

Kenny Bunch
kenny@wasabisystems.com

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Note that socks->sock_count is used throughout the function, so a local sock_count var may be required to avoid additional code rework. -Kenny

     
  • Nobody/Anonymous

    Logged In: NO

    Note that socks->sock_count is used throughout the function, so a local sock_count var may be required to avoid additional code rework. -Kenny

     

Log in to post a comment.