dpif-netdev: Fix memory leak.
authorBen Pfaff <blp@nicira.com>
Wed, 15 Aug 2012 22:19:18 +0000 (15:19 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 16 Aug 2012 16:47:09 +0000 (09:47 -0700)
upcall->packet is allocated with malloc(), via ofpbuf_new(), but nothing
ever frees it.

Found by valgrind.

CC: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/dpif-netdev.c

index 7fa2720..3d01b17 100644 (file)
@@ -966,6 +966,7 @@ dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall,
 
         ofpbuf_uninit(buf);
         *buf = *upcall->packet;
+        free(upcall->packet);
 
         return 0;
     } else {