Skip to content

Commit

Permalink
ovsdb: Fix double-free in ovsdb_jsonrpc_session_close().
Browse files Browse the repository at this point in the history
ovsdb_session_destroy() was called twice but it should only be called once.

This double-free is unlikely to cause problems in practice because it only
triggers if there were ever more than two outstanding requests in the
session at a time (because the only data being freed is an hmap, which
does not allocate any heap memory unless the hmap has more than two
elements).

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Ethan Jackson <[email protected]>
  • Loading branch information
blp committed Jan 24, 2013
1 parent 40fa941 commit 0b6a64c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ovsdb/jsonrpc-server.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
/* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -386,7 +386,6 @@ ovsdb_jsonrpc_session_close(struct ovsdb_jsonrpc_session *s)
ovsdb_jsonrpc_session_unlock_all(s);
jsonrpc_session_close(s->js);
list_remove(&s->node);
ovsdb_session_destroy(&s->up);
s->remote->server->n_sessions--;
ovsdb_session_destroy(&s->up);
free(s);
Expand Down

0 comments on commit 0b6a64c

Please sign in to comment.