diff mbox

[ovs-dev] stream-ssl: Fix memory leak on error path.

Message ID 1476468763-29877-1-git-send-email-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff Oct. 14, 2016, 6:12 p.m. UTC
The commit that this fixes is from 2009.

Reported-by: Kai-Wei Fan <fank@vmware.com>
Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/stream-ssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Zhou Oct. 14, 2016, 8:11 p.m. UTC | #1
On Fri, Oct 14, 2016 at 11:12 AM, Ben Pfaff <blp@ovn.org> wrote:

> The commit that this fixes is from 2009.
>
> Reported-by: Kai-Wei Fan <fank@vmware.com>
> Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.")
> Signed-off-by: Ben Pfaff <blp@ovn.org>
>

LGTM
Acked-by: Andy Zhou <azhou@ovn.org>
Ben Pfaff Oct. 17, 2016, 5:49 p.m. UTC | #2
On Fri, Oct 14, 2016 at 01:11:07PM -0700, Andy Zhou wrote:
> On Fri, Oct 14, 2016 at 11:12 AM, Ben Pfaff <blp@ovn.org> wrote:
> 
> > The commit that this fixes is from 2009.
> >
> > Reported-by: Kai-Wei Fan <fank@vmware.com>
> > Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.")
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> >
> 
> LGTM
> Acked-by: Andy Zhou <azhou@ovn.org>

Thanks, I applied this to master and to branches back to 2.3.
diff mbox

Patch

diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
index a5c32a1..dcafc2d 100644
--- a/lib/stream-ssl.c
+++ b/lib/stream-ssl.c
@@ -670,7 +670,7 @@  ssl_send(struct stream *stream, const void *buffer, size_t n)
         case EAGAIN:
             return n;
         default:
-            sslv->txbuf = NULL;
+            ssl_clear_txbuf(sslv);
             return -error;
         }
     }