Resolved ASAN issues
[platform/core/api/location-manager.git] / src / location_internal.c
index 054a4a0..ede0a44 100644 (file)
@@ -179,8 +179,12 @@ int __set_callback(_location_event_e type, location_manager_h manager, void *cal
        LOCATIONS_NULL_ARG_CHECK(manager);
        LOCATIONS_NULL_ARG_CHECK(callback);
        location_manager_s *handle = (location_manager_s *) manager;
-       handle->user_cb[type] = callback;
-       handle->user_data[type] = user_data;
+       if (handle != NULL){
+               handle->user_cb[type] = callback;
+               handle->user_data[type] = user_data;
+       }
+       else
+               LOCATIONS_LOGE("Null Handle");
        LOCATIONS_LOGD("event type : %d", type);
        return LOCATIONS_ERROR_NONE;
 }
@@ -189,8 +193,12 @@ int __unset_callback(_location_event_e type, location_manager_h manager)
 {
        LOCATIONS_NULL_ARG_CHECK(manager);
        location_manager_s *handle = (location_manager_s *) manager;
-       handle->user_cb[type] = NULL;
-       handle->user_data[type] = NULL;
+       if (handle != NULL){
+               handle->user_cb[type] = NULL;
+               handle->user_data[type] = NULL;
+       }
+       else
+               LOCATIONS_LOGE("Null Handle");
        LOCATIONS_LOGD("event type : %d", type);
        return LOCATIONS_ERROR_NONE;
 }