WNM: Fix possible memory leak by free buf
Buf is allocated and may not be freed on an error path. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
This commit is contained in:
parent
9bd0273931
commit
b62b0cb78a
1 changed files with 4 additions and 1 deletions
|
@ -564,8 +564,11 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
|
||||||
if (url) {
|
if (url) {
|
||||||
/* Session Information URL */
|
/* Session Information URL */
|
||||||
url_len = os_strlen(url);
|
url_len = os_strlen(url);
|
||||||
if (url_len > 255)
|
if (url_len > 255) {
|
||||||
|
os_free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
*pos++ = url_len;
|
*pos++ = url_len;
|
||||||
os_memcpy(pos, url, url_len);
|
os_memcpy(pos, url, url_len);
|
||||||
pos += url_len;
|
pos += url_len;
|
||||||
|
|
Loading…
Add table
Reference in a new issue