Skip to content

lm_old_socket_close() leaks a file descriptor if connect() has not succeeded #2

Description

@emezeske

socket_close_io_channel() is not called on the socket file descriptor if lm_old_socket_close() is called between when connect() has been called and when it has succeeded/failed. This patch contains my fix for the problem (why doesn't github have attachments yet?):

diff -crB engineyard-loudmouth.old/loudmouth/lm-old-socket.c engineyard-loudmouth.new/loudmouth/lm-old-socket.c
*** engineyard-loudmouth.old/loudmouth/lm-old-socket.c 2009-09-17 19:34:58.000000000 -0700
--- engineyard-loudmouth.new/loudmouth/lm-old-socket.c 2009-09-17 19:36:54.000000000 -0700


*** 951,956 ****
--- 951,959 ----

  data = socket->connect_data;
  if (data) {
  •     if (data->io_channel) {
    
  •         socket_close_io_channel (data->io_channel);
    
  •     }
      socket->connect_data = NULL;
      g_free (data);
    
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions