new_ie is used as a temporary storage for the generation of
the new elements. However, after copying from it the memory
wasn't freed and leaked. Free it.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (!new_ie)
return;
new_ies = kzalloc(sizeof(*new_ies) + new_ie_len, gfp);
- if (!new_ies) {
- kfree(new_ie);
- return;
- }
+ if (!new_ies)
+ goto out_free;
pos = new_ie;
if (old)
kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);
}
+
+out_free:
+ kfree(new_ie);
}
/* cfg80211_inform_bss_width_frame helper */