]> git.ipfire.org Git - thirdparty/iw.git/commit
iw: Fix memory leak if nla_put fails
authorOla Olsson <ola1olsson@gmail.com>
Fri, 23 Oct 2015 22:33:12 +0000 (00:33 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Nov 2015 10:27:30 +0000 (11:27 +0100)
commitab65a092653d0eea237070ea785f8f2ab6da11e5
tree66c9eefe7005879064c5adb74380e74e1f50d4ed
parent33cbe6cdd261146a1ac69839aca295c547b95d38
iw: Fix memory leak if nla_put fails

The NLA_PUT macro will automatically goto nla_put_failure if
the underlying nla_put fails. This will in turn leak our malloced
memory in both the scan and wowlan commands.
Fix that by not using the macro in the cases where we have
allocated heap mem.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
scan.c
wowlan.c