diff --git a/model/network/ethernet/src/eth_device.c b/model/network/ethernet/src/eth_device.c index aaafb4da..bd6b566a 100644 --- a/model/network/ethernet/src/eth_device.c +++ b/model/network/ethernet/src/eth_device.c @@ -248,6 +248,7 @@ struct EthConfig *GetEthConfig(const struct DeviceResourceNode *node) if (ParseConfigFromProperty(node, config) != HDF_SUCCESS) { HDF_LOGE("%s failed to parse config from property", __func__); + OsalMemFree(config); return NULL; } return config; @@ -289,4 +290,4 @@ int32_t ReleaseEthDevice(struct EthDevice *ethDevice) OsalMemFree(ethDevice); OsalMemFree(data); return HDF_SUCCESS; -} \ No newline at end of file +} diff --git a/model/network/wifi/platform/src/hdf_wlan_utils.c b/model/network/wifi/platform/src/hdf_wlan_utils.c index a6bd35cc..929ae158 100644 --- a/model/network/wifi/platform/src/hdf_wlan_utils.c +++ b/model/network/wifi/platform/src/hdf_wlan_utils.c @@ -81,7 +81,7 @@ int32_t RenewNetDevice(NetDevice **netDev) HDF_LOGE("%s:bad net device!", __func__); return HDF_FAILURE; } - if (strcpy_s(ifName, IFNAMSIZ, (*netDev)->name) < 0) { + if (strcpy_s(ifName, IFNAMSIZ, (*netDev)->name) != EOK) { HDF_LOGE("%s:Copy ifName failed!", __func__); return HDF_FAILURE; }