Fixing memory leak issues in test files 50/33350/1
authorVibhor Gaur <vibhor.gaur@samsung.com>
Thu, 8 Jan 2015 12:41:35 +0000 (18:11 +0530)
committerVibhor Gaur <vibhor.gaur@samsung.com>
Thu, 8 Jan 2015 12:41:41 +0000 (18:11 +0530)
Change-Id: I1aeeab6fc7e02c7d75c1f7671f9f77afbd42954f

test/src/accelerometer.c
test/src/gravity.c
test/src/gyro.c
test/src/light.c
test/src/linear_acceleration.c
test/src/orientation.c
test/src/pressure.c
test/src/proxi.c
test/src/temperature.c

index fe61f37..cef4971 100644 (file)
@@ -73,6 +73,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't start accelerometer SENSOR\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
 
@@ -89,6 +90,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't disconnect Accelerometer sensor\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
        }
@@ -112,6 +114,7 @@ int main(int argc,char **argv)
                        printf("Error\n\n\n\n");
                        sf_unregister_event(handle, event);
                        sf_disconnect(handle);
+                       free(event_condition);
                        return -1;
                }
 
@@ -125,6 +128,7 @@ int main(int argc,char **argv)
                if (stop_handle < 0) {
                        printf("Error\n\n");
                        return -1;
+                       free(event_condition);
                }
 
                sf_disconnect(handle);
index a055013..d3cba2d 100755 (executable)
@@ -86,6 +86,7 @@ int main(int argc,char **argv)
                printf("Error\n\n\n\n");
                sf_unregister_event(handle, event);
                sf_disconnect(handle);
+               free(event_condition);
                return -1;
        }
 
@@ -97,6 +98,7 @@ int main(int argc,char **argv)
 
        if (stop_handle < 0) {
                printf("Error\n\n");
+               free(event_condition);
                return -1;
        }
 
index 915971b..a3332f7 100644 (file)
@@ -75,6 +75,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't start gyroscope SENSOR\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
 
@@ -91,6 +92,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't disconnect gyroscope sensor\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
        }
@@ -114,6 +116,7 @@ int main(int argc,char **argv)
                        printf("Error\n\n\n\n");
                        sf_unregister_event(handle, event);
                        sf_disconnect(handle);
+                       free(event_condition);
                        return -1;
                }
 
@@ -126,6 +129,7 @@ int main(int argc,char **argv)
 
                if (stop_handle < 0) {
                        printf("Error\n\n");
+                       free(event_condition);
                        return -1;
                }
 
index e2b6e69..ba99732 100644 (file)
@@ -75,6 +75,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't start light SENSOR\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
 
@@ -90,6 +91,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't disconnect light sensor\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
        }
@@ -113,6 +115,7 @@ int main(int argc,char **argv)
                        printf("Error\n\n\n\n");
                        sf_unregister_event(handle, event);
                        sf_disconnect(handle);
+                       free(event_condition);
                        return -1;
                }
 
@@ -125,6 +128,7 @@ int main(int argc,char **argv)
 
                if (stop_handle < 0) {
                        printf("Error\n\n");
+                       free(event_condition);
                        return -1;
                }
 
index e45f4cc..f992a68 100755 (executable)
@@ -86,6 +86,7 @@ int main(int argc,char **argv)
                printf("Error\n\n\n\n");
                sf_unregister_event(handle, event);
                sf_disconnect(handle);
+               free(event_condition);
                return -1;
        }
 
@@ -98,6 +99,7 @@ int main(int argc,char **argv)
 
        if (stop_handle < 0) {
                printf("Error\n\n");
+               free(event_condition);
                return -1;
        }
 
index 1886ad1..57bc82b 100755 (executable)
@@ -86,6 +86,7 @@ int main(int argc,char **argv)
                printf("Error\n\n\n\n");
                sf_unregister_event(handle, event);
                sf_disconnect(handle);
+               free(event_condition);
                return -1;
        }
 
@@ -97,6 +98,7 @@ int main(int argc,char **argv)
 
        if (stop_handle < 0) {
                printf("Error\n\n");
+               free(event_condition);
                return -1;
        }
        sf_disconnect(handle);
index 12f5734..7621160 100644 (file)
@@ -75,6 +75,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't start pressure SENSOR\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
 
@@ -91,6 +92,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't disconnect pressure sensor\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
        }
@@ -114,6 +116,7 @@ int main(int argc,char **argv)
                        printf("Error\n\n\n\n");
                        sf_unregister_event(handle, event);
                        sf_disconnect(handle);
+                       free(event_condition);
                        return -1;
                }
 
@@ -126,6 +129,7 @@ int main(int argc,char **argv)
 
                if (stop_handle < 0) {
                        printf("Error\n\n");
+                       free(event_condition);
                        return -1;
                }
 
index 4d3092d..23da057 100644 (file)
@@ -90,6 +90,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't start proximity SENSOR\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
 
@@ -106,6 +107,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't disconnect proximity sensor\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
        }
@@ -144,6 +146,7 @@ int main(int argc,char **argv)
                        printf("Error\n\n\n\n");
                        sf_unregister_event(handle, event);
                        sf_disconnect(handle);
+                       free(event_condition);
                        return -1;
                }
 
@@ -156,6 +159,7 @@ int main(int argc,char **argv)
 
                if (stop_handle < 0) {
                        printf("Error\n\n");
+                       free(event_condition);
                        return -1;
                }
 
index 3f852c8..01e6e81 100644 (file)
@@ -74,6 +74,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't start temperature SENSOR\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
 
@@ -90,6 +91,7 @@ int main(int argc,char **argv)
                if (result < 0) {
                        printf("Can't disconnect temperature sensor\n");
                        printf("Error\n\n\n\n");
+                       free(event_condition);
                        return -1;
                }
        }
@@ -113,6 +115,7 @@ int main(int argc,char **argv)
                        printf("Error\n\n\n\n");
                        sf_unregister_event(handle, event);
                        sf_disconnect(handle);
+                       free(event_condition);
                        return -1;
                }
 
@@ -125,6 +128,7 @@ int main(int argc,char **argv)
 
                if (stop_handle < 0) {
                        printf("Error\n\n");
+                       free(event_condition);
                        return -1;
                }