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 7fa272084bfe41c3e751b50af919b048a58d696f..3d01b17aabc0c8ec97f884dd0453b747568632c9 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 {