ovsdb-server: Fix crash for invalid parameters to "monitor" request.
authorBen Pfaff <blp@nicira.com>
Wed, 18 Nov 2009 19:32:16 +0000 (11:32 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 18 Nov 2009 19:32:16 +0000 (11:32 -0800)
Thanks to Jeremy Stribling <strib@nicira.com> for reporting the problem.

ovsdb/jsonrpc-server.c

index fc8b194e9ff59b6084182735818e11ab8388f7f5..4644970d517c56ece1ea71fe44aafb468e576123 100644 (file)
@@ -714,7 +714,9 @@ ovsdb_jsonrpc_monitor_create(struct ovsdb_jsonrpc_session *s,
     return ovsdb_jsonrpc_monitor_get_initial(m);
 
 error:
-    ovsdb_remove_replica(s->server->db, &m->replica);
+    if (m) {
+        ovsdb_remove_replica(s->server->db, &m->replica);
+    }
 
     json = ovsdb_error_to_json(error);
     ovsdb_error_destroy(error);