diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-05-24 10:37:41 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-10-08 15:51:00 +0200 |
commit | 00bb4d0ca0417f231715844e613c46dd69f241fd (patch) | |
tree | 7d132634dee32b70f9de8d8d0f31010e57c08f9b /4a-hal/4a-hal-utilities/4a-hal-utilities-data.c | |
parent | e7d27f6f456c0cd5e2c2e506928619520dbfe917 (diff) |
Remove some unnecessary free
Remove some unnecessary free that used to free strings that are
handled by controller.
Remove test if NULL before free (free doesn't do anything if
pointer is NULL).
Change-Id: I9f9bdb3f194900567da6bd2dada6dae4ea87b1fa
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-utilities/4a-hal-utilities-data.c')
-rw-r--r-- | 4a-hal/4a-hal-utilities/4a-hal-utilities-data.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c index 11721f2..0001093 100644 --- a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c +++ b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c @@ -93,21 +93,6 @@ uint8_t HalUtlRemoveSelectedHalFromList(struct HalMgrData *HalMgrGlobalData, str } } - if(matchingApi->apiName) - free(matchingApi->apiName); - - if(matchingApi->sndCard) - free(matchingApi->sndCard); - - if(matchingApi->author) - free(matchingApi->author); - - if(matchingApi->version) - free(matchingApi->version); - - if(matchingApi->date) - free(matchingApi->date); - free(matchingApi); return 0; @@ -197,11 +182,8 @@ void HalUtlRemoveHalMgrData(struct HalMgrData *HalMgrGlobalData) if(HalMgrGlobalData->first) HalUtlRemoveAllHalFromList(HalMgrGlobalData); - if(HalMgrGlobalData->apiName) - free(HalMgrGlobalData->apiName); - - if(HalMgrGlobalData->info) - free(HalMgrGlobalData->info); + free(HalMgrGlobalData->apiName); + free(HalMgrGlobalData->info); free(HalMgrGlobalData); }
\ No newline at end of file |