Skip to content

Commit

Permalink
dpif-netdev: Fix memory leak in dpif_netdev_flow_put()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Ryan Wilson authored and blp committed Jun 25, 2014
1 parent 8bb113d commit 5715de1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,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;
}
Expand Down

0 comments on commit 5715de1

Please sign in to comment.