nl80211: Fix memory leak on start radar detection error path

Free nlmsg if failing to start radar detection.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
Janusz Dziedzic 2014-09-26 20:21:25 +02:00 committed by Jouni Malinen
parent ed8e005973
commit dbdc9a1d48

View file

@ -11527,11 +11527,13 @@ static int nl80211_start_radar_detection(void *priv,
goto nla_put_failure;
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
msg = NULL;
if (ret == 0)
return 0;
wpa_printf(MSG_DEBUG, "nl80211: Failed to start radar detection: "
"%d (%s)", ret, strerror(-ret));
nla_put_failure:
nlmsg_free(msg);
return -1;
}