Fix vconn_transact() bug introduced in commit 65ac65a6d2,
authorBen Pfaff <blp@nicira.com>
Thu, 30 Oct 2008 17:38:03 +0000 (10:38 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 30 Oct 2008 17:38:03 +0000 (10:38 -0700)
"Improve the command interface so that it sends back acks or errors."

Oops.  That was dumb.

Thanks to Justin for reporting the problem.

lib/vconn.c

index b96962823092a27c2d4b007c058e62d4a84fea96..b37656a75b6ce8b517e121974d7fc69d6a24a00c 100644 (file)
@@ -598,7 +598,9 @@ vconn_transact(struct vconn *vconn, struct ofpbuf *request,
 
     *replyp = NULL;
     error = vconn_send_block(vconn, request);
-    ofpbuf_delete(request);
+    if (error) {
+        ofpbuf_delete(request);
+    }
     return error ? error : vconn_recv_xid(vconn, send_xid, replyp);
 }