Move wpa_scan_results_free() into shared C file

Replace the inline helper function with a new C file that can be used
for common driver API related function.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2011-11-13 18:56:26 +02:00
parent a4cef16279
commit aea855d752
10 changed files with 53 additions and 13 deletions

View file

@ -3492,17 +3492,7 @@ static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
}
static inline void wpa_scan_results_free(struct wpa_scan_results *res)
{
size_t i;
if (res == NULL)
return;
for (i = 0; i < res->num; i++)
os_free(res->res[i]);
os_free(res->res);
os_free(res);
}
/* driver_common.c */
void wpa_scan_results_free(struct wpa_scan_results *res);
#endif /* DRIVER_H */

View file

@ -0,0 +1,30 @@
/*
* Common driver-related functions
* Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
* See README and COPYING for more details.
*/
#include "includes.h"
#include "utils/common.h"
#include "driver.h"
void wpa_scan_results_free(struct wpa_scan_results *res)
{
size_t i;
if (res == NULL)
return;
for (i = 0; i < res->num; i++)
os_free(res->res[i]);
os_free(res->res);
os_free(res);
}