> +/* Replaces 'dst' by 'src', destroying 'src'.  The caller must eventually 
> free
> + * 'dst' with miniflow_destroy(). */
> +void
> +miniflow_move(struct miniflow *dst, struct miniflow *src)
> +{
> +    int n = miniflow_n_values(src);
> +    if (n <= MINI_N_INLINE) {
> +        dst->values = dst->inline_values;
> +        memcpy(dst->values, src->values, n * sizeof *dst->values);

Does this leak memory in the case where miniflow_n_values(dst) >
MINI_N_INLINE?  Later when we destroy dst, we don't know that we
should be freeing dst->values because dst->values ==
dst->inline_values.  Or, are we assuming that dst hasn't already been
initialized?  In that case I think the function comment on this and
cls_rule_move() could be expanded.

Acked-by: Ethan Jackson <et...@nicira.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to