diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 9a362f0a..9b2e7ddc 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -85,7 +85,7 @@ GnssInterface* Gnss::getGnssInterface() { if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); getLocationInterface* getter = NULL; - const char *error; + const char *error = NULL; dlerror(); void *handle = dlopen("libgnss.so", RTLD_NOW); if (NULL == handle || (error = dlerror()) != NULL) { diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 3086adc1..60a46fe5 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -82,7 +82,7 @@ static void* loadLocationInterface(const char* library, const char* name) { return NULL; } getLocationInterface* getter = NULL; - const char *error; + const char *error = NULL; dlerror(); void *handle = dlopen(library, RTLD_NOW); if (NULL == handle || (error = dlerror()) != NULL) {