Fix memory leak in secure channel.
authorBen Pfaff <blp@nicira.com>
Mon, 5 May 2008 21:44:24 +0000 (14:44 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 5 May 2008 23:06:56 +0000 (16:06 -0700)
Thanks to Reid for noticing and helping to track down this leak.

secchan/secchan.c

index 8ac3d4190dad7b2869ffdecd7dd06aa0016f78ea..25bd794129db7f8b479dd6d58a496d428d3f6214 100644 (file)
@@ -221,10 +221,12 @@ relay_run(struct relay *r)
             if (this->rxbuf) {
                 int retval = rconn_send(peer->rconn, this->rxbuf);
                 if (retval != EAGAIN) {
-                    this->rxbuf = NULL;
                     if (!retval) {
                         progress = true;
+                    } else {
+                        buffer_delete(this->rxbuf);
                     }
+                    this->rxbuf = NULL;
                 }
             }
         }