jsonrpc: Fix potential memory leak.
authorBen Pfaff <blp@nicira.com>
Wed, 24 Mar 2010 00:20:42 +0000 (17:20 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Mar 2010 23:52:07 +0000 (16:52 -0700)
This is unlikely to occur very often in practice, because s->stream
usually gets stuffed into s->rpc before long, but it is still a good idea
to fix it.

lib/jsonrpc.c

index 5c7dfca9ef85e4cb34c60ca8b8a85eb06d15cb34..5e054802f785b2af53a61c31e8da0c32bdfac996 100644 (file)
@@ -684,6 +684,7 @@ jsonrpc_session_close(struct jsonrpc_session *s)
     if (s) {
         jsonrpc_close(s->rpc);
         reconnect_destroy(s->reconnect);
+        stream_close(s->stream);
         free(s);
     }
 }