From: Ryan Wilson Date: Wed, 25 Jun 2014 20:05:17 +0000 (-0700) Subject: dpif-netdev: Fix memory leak in dpif_netdev_flow_put() X-Git-Tag: v2.3~51 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=c4f9cffed2ae1736cd43bbfaab4d0af7e743f5fd dpif-netdev: Fix memory leak in dpif_netdev_flow_put() miniflow_destroy() needs to be called after using miniflow_init(). Otherwise, if the miniflow mallocs data, then a memory leak may occur. Found by inspection. Signed-off-by: Ryan Wilson Signed-off-by: Ben Pfaff --- diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index bbdb16913..9edbe4cd7 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1339,6 +1339,7 @@ dpif_netdev_flow_put(struct dpif *dpif, const struct dpif_flow_put *put) } } ovs_mutex_unlock(&dp->flow_mutex); + miniflow_destroy(&miniflow); return error; }