Message ID | 1469563687-5352-2-git-send-email-azhou@ovn.org |
---|---|
State | Accepted |
Headers | show |
thanks for fixing the memory leak! Acked-by: William Tu <u9012063@gmail.com> On Tue, Jul 26, 2016 at 1:08 PM, Andy Zhou <azhou@ovn.org> wrote: > Release the memory of reply message of the initial "monitor" request. > > Reported-at: http://openvswitch.org/pipermail/dev/2016-July/076075.html > Signed-off-by: Andy Zhou <azhou@ovn.org> > --- > ovsdb/replication.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/ovsdb/replication.c b/ovsdb/replication.c > index 3d589ef..af7ae5c 100644 > --- a/ovsdb/replication.c > +++ b/ovsdb/replication.c > @@ -365,6 +365,10 @@ get_initial_db_state(const struct db *database) > if (msg->type == JSONRPC_REPLY) { > process_notification(msg->result, database->db); > } > + > + if (msg) { > + jsonrpc_msg_destroy(msg); > + } > } > > static void > -- > 1.9.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev
On Tue, Jul 26, 2016 at 01:08:06PM -0700, Andy Zhou wrote: > Release the memory of reply message of the initial "monitor" request. > > Reported-at: http://openvswitch.org/pipermail/dev/2016-July/076075.html > Signed-off-by: Andy Zhou <azhou@ovn.org> > --- > ovsdb/replication.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/ovsdb/replication.c b/ovsdb/replication.c > index 3d589ef..af7ae5c 100644 > --- a/ovsdb/replication.c > +++ b/ovsdb/replication.c > @@ -365,6 +365,10 @@ get_initial_db_state(const struct db *database) > if (msg->type == JSONRPC_REPLY) { > process_notification(msg->result, database->db); > } > + > + if (msg) { > + jsonrpc_msg_destroy(msg); > + } > } The 'if' isn't needed.
On Wed, Jul 27, 2016 at 12:43 PM, Ben Pfaff <blp@ovn.org> wrote: > On Tue, Jul 26, 2016 at 01:08:06PM -0700, Andy Zhou wrote: > > Release the memory of reply message of the initial "monitor" request. > > > > Reported-at: http://openvswitch.org/pipermail/dev/2016-July/076075.html > > Signed-off-by: Andy Zhou <azhou@ovn.org> > > --- > > ovsdb/replication.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/ovsdb/replication.c b/ovsdb/replication.c > > index 3d589ef..af7ae5c 100644 > > --- a/ovsdb/replication.c > > +++ b/ovsdb/replication.c > > @@ -365,6 +365,10 @@ get_initial_db_state(const struct db *database) > > if (msg->type == JSONRPC_REPLY) { > > process_notification(msg->result, database->db); > > } > > + > > + if (msg) { > > + jsonrpc_msg_destroy(msg); > > + } > > } > > The 'if' isn't needed. > Right, jsonrpc_msg_destroy() checks for NULL internally. I will drop the 'if' before pushing. Thanks for catching it.
On Wed, Jul 27, 2016 at 12:48 PM, Andy Zhou <azhou@ovn.org> wrote: > > > On Wed, Jul 27, 2016 at 12:43 PM, Ben Pfaff <blp@ovn.org> wrote: > >> On Tue, Jul 26, 2016 at 01:08:06PM -0700, Andy Zhou wrote: >> > Release the memory of reply message of the initial "monitor" request. >> > >> > Reported-at: http://openvswitch.org/pipermail/dev/2016-July/076075.html >> > Signed-off-by: Andy Zhou <azhou@ovn.org> >> > --- >> > ovsdb/replication.c | 4 ++++ >> > 1 file changed, 4 insertions(+) >> > >> > diff --git a/ovsdb/replication.c b/ovsdb/replication.c >> > index 3d589ef..af7ae5c 100644 >> > --- a/ovsdb/replication.c >> > +++ b/ovsdb/replication.c >> > @@ -365,6 +365,10 @@ get_initial_db_state(const struct db *database) >> > if (msg->type == JSONRPC_REPLY) { >> > process_notification(msg->result, database->db); >> > } >> > + >> > + if (msg) { >> > + jsonrpc_msg_destroy(msg); >> > + } >> > } >> >> The 'if' isn't needed. >> > Right, jsonrpc_msg_destroy() checks for NULL internally. > > I will drop the 'if' before pushing. Thanks for catching it. > Pushed to master.
diff --git a/ovsdb/replication.c b/ovsdb/replication.c index 3d589ef..af7ae5c 100644 --- a/ovsdb/replication.c +++ b/ovsdb/replication.c @@ -365,6 +365,10 @@ get_initial_db_state(const struct db *database) if (msg->type == JSONRPC_REPLY) { process_notification(msg->result, database->db); } + + if (msg) { + jsonrpc_msg_destroy(msg); + } } static void
Release the memory of reply message of the initial "monitor" request. Reported-at: http://openvswitch.org/pipermail/dev/2016-July/076075.html Signed-off-by: Andy Zhou <azhou@ovn.org> --- ovsdb/replication.c | 4 ++++ 1 file changed, 4 insertions(+)