[ITC][capi-maps-service][Non-ACR][DPTTIZEN-2886-Fix for crash]
authorShilpa Jindal <shilpa.j@samsung.com>
Tue, 1 Aug 2017 09:00:05 +0000 (14:30 +0530)
committerjomui <jongmun.woo@samsung.com>
Tue, 1 Aug 2017 10:59:21 +0000 (19:59 +0900)
Change-Id: Ic2e7b7be841973d6928944325503fec64ad521b4
Signed-off-by: Shilpa Jindal <shilpa.j@samsung.com>
src/itc/capi-maps-service/ITs-capi-maps-service-here.c
src/itc/capi-maps-service/ITs-capi-maps-service-mapzen.c

index 0156d47..b4ea3bc 100755 (executable)
@@ -1295,29 +1295,29 @@ int ITc_maps_service_multi_reverse_geocode_p(void)
        CHECK_HANDLE(hMapCoordinate[0], "maps_coordinates_create");
 
        nRet = maps_coordinates_create(0.1618996, 8.997, &hMapCoordinate[1]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
        CHECK_HANDLE(hMapCoordinate[1], "maps_coordinates_create");
 
        nRet = maps_coordinates_create(0.79660710, -7.986800809087, &hMapCoordinate[2]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
        CHECK_HANDLE(hMapCoordinate[2], "maps_coordinates_create");
 
        nRet = maps_coordinates_create(.03, 1.4, &hMapCoordinate[3]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
        CHECK_HANDLE(hMapCoordinate[3], "maps_coordinates_create");
 
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[0]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[1]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[2]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[3]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
                        
        nRet = maps_service_multi_reverse_geocode(g_hMapService, hMapCoordinateList, g_hMapsPref, MapServiceMultiRevGeocodeCb, NULL, &nRequestId);      
        if ( false == bInternetFeatureSupported)
index d92d431..9681710 100755 (executable)
@@ -1298,32 +1298,32 @@ int ITc_maps_service_multi_reverse_geocode_p2(void)
 
        nRet = maps_coordinates_create(.09, 1.8, &hMapCoordinate[0]);
        PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
-       CHECK_HANDLE_CLEANUP(hMapCoordinate[0], "maps_coordinates_create",g_free(hMapCoordinate));
+       CHECK_HANDLE(hMapCoordinate[0], "maps_coordinates_create");
 
        nRet = maps_coordinates_create(0.1618996, 8.997, &hMapCoordinate[1]);
        PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
-       CHECK_HANDLE_CLEANUP(hMapCoordinate[1], "maps_coordinates_create",g_free(hMapCoordinate));
+       CHECK_HANDLE(hMapCoordinate[1], "maps_coordinates_create");
 
        nRet = maps_coordinates_create(0.79660710, -7.986800809087, &hMapCoordinate[2]);
        PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
-       CHECK_HANDLE_CLEANUP(hMapCoordinate[2], "maps_coordinates_create",g_free(hMapCoordinate));
+       CHECK_HANDLE(hMapCoordinate[2], "maps_coordinates_create");
 
        nRet = maps_coordinates_create(.03, 1.4, &hMapCoordinate[3]);
        PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
-       CHECK_HANDLE_CLEANUP(hMapCoordinate[3], "maps_coordinates_create",g_free(hMapCoordinate));
+       CHECK_HANDLE(hMapCoordinate[3], "maps_coordinates_create");
 
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[0]);
        PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[1]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[2]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
 
        nRet = maps_coordinates_list_append(hMapCoordinateList, hMapCoordinate[3]);
-       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[0]);maps_coordinates_destroy(hMapCoordinate[1]);maps_coordinates_destroy(hMapCoordinate[2]);maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
+       PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_append", MapServiceGetError(nRet),maps_coordinates_destroy(hMapCoordinate[3]);maps_coordinates_list_destroy(hMapCoordinateList);g_free(hMapCoordinate));
                        
        nRet = maps_service_multi_reverse_geocode(g_hMapService, hMapCoordinateList, g_hMapsPref, MapServiceMultiRevGeocodeCb, NULL, &nRequestId);      
        if ( false == bInternetFeatureSupported)
@@ -1332,10 +1332,6 @@ int ITc_maps_service_multi_reverse_geocode_p2(void)
                {
                        FPRINTF("[Line : %d][%s] maps_service_multi_reverse_geocode API call returned mismatch %s error for unsupported maps feature\\n", __LINE__, API_NAMESPACE, MapServiceGetError(nRet));
                        //g_bFeatureMismatch = true;
-                       maps_coordinates_destroy(hMapCoordinate[0]);
-                       maps_coordinates_destroy(hMapCoordinate[1]);
-                       maps_coordinates_destroy(hMapCoordinate[2]);
-                       maps_coordinates_destroy(hMapCoordinate[3]);
                        maps_coordinates_list_destroy(hMapCoordinateList);
                        g_free(hMapCoordinate);
                        return 1;
@@ -1344,10 +1340,6 @@ int ITc_maps_service_multi_reverse_geocode_p2(void)
                {
                        FPRINTF("[Line : %d][%s] maps_service_multi_reverse_geocode API call correctly returned %s error for unsupported maps feature\\n", __LINE__, API_NAMESPACE, MapServiceGetError(nRet));
                        //g_bFeatureNotSupported = true;
-                       maps_coordinates_destroy(hMapCoordinate[0]);
-                       maps_coordinates_destroy(hMapCoordinate[1]);
-                       maps_coordinates_destroy(hMapCoordinate[2]);
-                       maps_coordinates_destroy(hMapCoordinate[3]);
                        maps_coordinates_list_destroy(hMapCoordinateList);
                        g_free(hMapCoordinate);
                        return 0;
@@ -1356,10 +1348,6 @@ int ITc_maps_service_multi_reverse_geocode_p2(void)
        if((nRet != MAPS_ERROR_NONE)&&(nRet != MAPS_ERROR_NOT_SUPPORTED))
        {
                FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, "maps_service_multi_reverse_geocode", MapServiceGetError(nRet), nRet);
-               maps_coordinates_destroy(hMapCoordinate[0]);
-               maps_coordinates_destroy(hMapCoordinate[1]);
-               maps_coordinates_destroy(hMapCoordinate[2]);
-               maps_coordinates_destroy(hMapCoordinate[3]);
                maps_coordinates_list_destroy(hMapCoordinateList);
                g_free(hMapCoordinate);
                return 1;
@@ -1370,24 +1358,15 @@ int ITc_maps_service_multi_reverse_geocode_p2(void)
                if(g_nCheckCb != true)
                {
                        FPRINTF("[Line : %d][%s] Coordinates are not received from maps_service_reverse_geocode \\n", __LINE__, API_NAMESPACE);
-                       maps_coordinates_destroy(hMapCoordinate[0]);
-                       maps_coordinates_destroy(hMapCoordinate[1]);
-                       maps_coordinates_destroy(hMapCoordinate[2]);
-                       maps_coordinates_destroy(hMapCoordinate[3]);
                        maps_coordinates_list_destroy(hMapCoordinateList);
                        g_free(hMapCoordinate);
                        return 1;
                }
        }
 
-       maps_coordinates_destroy(hMapCoordinate[0]);
-       maps_coordinates_destroy(hMapCoordinate[1]);
-       maps_coordinates_destroy(hMapCoordinate[2]);
-       maps_coordinates_destroy(hMapCoordinate[3]);
-       
        nRet = maps_coordinates_list_destroy(hMapCoordinateList);
        PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_coordinates_list_destroy", MapServiceGetError(nRet),g_free(hMapCoordinate));
-                       
+
        g_free(hMapCoordinate);
 
        return 0;