From: Pravin B Shelar Date: Wed, 30 Nov 2011 22:17:15 +0000 (-0800) Subject: ofproto-dpif: Fix memory leak. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b17ca5c202c4c21b40890eb6bc12f364d849188;p=openvswitch ofproto-dpif: Fix memory leak. Following patch fixes memory leak in case there is ODP_FIT_ERROR on flow key. --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 14b54471..57534e36 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -2573,6 +2573,7 @@ handle_miss_upcalls(struct ofproto_dpif *ofproto, struct dpif_upcall *upcalls, upcall->key, upcall->key_len, &flow, &initial_tci); if (fitness == ODP_FIT_ERROR) { + ofpbuf_delete(upcall->packet); continue; } flow_extract(upcall->packet, flow.priority, flow.tun_id, @@ -2649,6 +2650,7 @@ handle_userspace_upcall(struct ofproto_dpif *ofproto, upcall->key_len, &flow, &initial_tci); if (fitness == ODP_FIT_ERROR) { + ofpbuf_delete(upcall->packet); return; } @@ -2664,6 +2666,7 @@ handle_userspace_upcall(struct ofproto_dpif *ofproto, &flow, false); } else { VLOG_WARN_RL(&rl, "invalid user cookie : 0x%"PRIx64, upcall->userdata); + ofpbuf_delete(upcall->packet); } }