From 923698ad8af4e9a01980d082009aa616e91d0a68 Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Thu, 6 Aug 2015 17:39:55 -0700 Subject: [PATCH] Clear passing up memory for LocApiBase function GpsLocation object need to be cleared in case the base calss member function being called so that no bad values will be passed up. Change-Id: I224ecebb3e4137c1baddd99ce0211a0f60d3e5b4 CRs-fixed: 879356 --- core/LocApiBase.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 5c852729..dcd35fec 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -489,16 +489,23 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getWwanZppFix(GpsLocation & zppLoc) + getWwanZppFix(GpsLocation& zppLoc) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(GpsLocation & zppLoc) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + getBestAvailableZppFix(GpsLocation& zppLoc) +{ + memset(&zppLoc, 0, sizeof(zppLoc)); + DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +} enum loc_api_adapter_err LocApiBase:: getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +{ + memset(&zppLoc, 0, sizeof(zppLoc)); + memset(&tech_mask, 0, sizeof(tech_mask)); + DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +} int LocApiBase:: initDataServiceClient()