diff options
author | Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com> | 2014-08-19 13:36:42 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-09-08 00:38:53 +0200 |
commit | 3cdce7080c98d840bb609a2fc2054e436b768013 (patch) | |
tree | 148994a50af452a16b35686f8f4a4959ffeed7b0 /lib | |
parent | f930a0997fb82214c42ad8bdee962403e8f9bd8c (diff) | |
download | neardal-3cdce7080c98d840bb609a2fc2054e436b768013.tar.gz neardal-3cdce7080c98d840bb609a2fc2054e436b768013.tar.bz2 neardal-3cdce7080c98d840bb609a2fc2054e436b768013.zip |
Use g_strfreev().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/neardal.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/lib/neardal.c b/lib/neardal.c index 2e1a392..90cd6ec 100644 --- a/lib/neardal.c +++ b/lib/neardal.c @@ -245,29 +245,13 @@ errorCode_t neardal_set_cb_record_found(record_cb cb_rcd_found, return NEARDAL_SUCCESS; } -/***************************************************************************** - * neardal_free_array: free adapters array, tags array or records array - ****************************************************************************/ errorCode_t neardal_free_array(char ***array) { - errorCode_t err = NEARDAL_SUCCESS; - char **adps; - - if (array == NULL) + if (array == NULL || *array == NULL) return NEARDAL_ERROR_INVALID_PARAMETER; - - if (*array == NULL) - return NEARDAL_ERROR_GENERAL_ERROR; - - adps = *array; - while ((*adps) != NULL) { - g_free(*adps); - adps++; - } - g_free(*array); + g_strfreev(*array); *array = NULL; - - return err; + return NEARDAL_SUCCESS; } /***************************************************************************** |