]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[sofia-sip] Fix memory leak when a tcp connection gives POLLERR due to RST.
authorAndrey Volk <andywolk@gmail.com>
Fri, 8 Nov 2019 15:00:59 +0000 (19:00 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 30 Dec 2019 20:54:49 +0000 (00:54 +0400)
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/tport/tport.c

index d5e9004486a2581a07860a1d2d46fdfb884f1b64..a988844f14855be8c08d41cfcd2aebe9aaa44ee9 100644 (file)
@@ -1 +1 @@
-Tue Oct 08 10:50:11 CDT 2019
+Fri Nov 08 08:54:20 CDT 2019
index 68b401be23fac85ab8a34d146058b7c34f86478d..fbfdfa56b68acd29e83e51776ea977a8772863e6 100644 (file)
@@ -2767,6 +2767,7 @@ static int tport_wakeup_pri(su_root_magic_t *m, su_wait_t *w, tport_t *self)
 int tport_wakeup(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
 {
   int events = su_wait_events(w, self->tp_socket);
+  int error;
 
 #if HAVE_POLL
   assert(w->fd == self->tp_socket);
@@ -2781,9 +2782,16 @@ int tport_wakeup(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
              self->tp_closed ? " (closed)" : ""));
 
   if (self->tp_pri->pri_vtable->vtp_wakeup)
-    return self->tp_pri->pri_vtable->vtp_wakeup(self, events);
+    error = self->tp_pri->pri_vtable->vtp_wakeup(self, events);
   else
-    return tport_base_wakeup(self, events);
+    error = tport_base_wakeup(self, events);
+
+  if (tport_is_closed(self)) {
+    SU_DEBUG_9(("%s(%p): tport is closed! Setting secondary timer!\n", "tport_wakeup", (void *)self));
+    tport_set_secondary_timer(self);
+  }
+
+  return error;
 }
 
 static int tport_base_wakeup(tport_t *self, int events)