[Fixed Bug] Fixed delete[] to free() 58/74858/1 accepted/tizen/common/20160620.163300 accepted/tizen/ivi/20160620.082453 accepted/tizen/mobile/20160620.082322 accepted/tizen/tv/20160620.082353 accepted/tizen/wearable/20160620.082426 submit/tizen/20160617.072816
authorTae-Young Chung <ty83.chung@samsung.com>
Thu, 16 Jun 2016 02:02:56 +0000 (11:02 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Thu, 16 Jun 2016 02:07:53 +0000 (11:07 +0900)
[cause]
In mv_engine_config_set_string_attribute(), new[] operator had been changed to malloc()
Thus, the parts calling mv_engine_config_get_string_attribute should have to use free()
instead of delete[] operator.

[solve]
The parts using mv_engine_config_get_string_attribute() is changed to deallocate memory by free()

Change-Id: I60ef4823e43229214c31d0706e53d3aa51c8d600
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
mv_barcode/barcode_generator/src/mv_barcode_generate_open.cpp
mv_face/face/src/mv_face_open.cpp
mv_surveillance/surveillance/src/EventTriggerPersonRecognition.cpp
packaging/capi-media-vision.spec

index 498cbf9..ddf552e 100644 (file)
@@ -241,7 +241,7 @@ int mv_barcode_generate_source_open(
                error = mv_engine_config_get_string_attribute(engine_cfg, "MV_BARCODE_GENERATE_ATTR_COLOR_FRONT", &fgcolour);
                if (error != MEDIA_VISION_ERROR_NONE) {
                        if (fgcolour) {
-                               delete [] fgcolour;
+                               free(fgcolour);
                                fgcolour = NULL;
                        }
 
@@ -252,12 +252,12 @@ int mv_barcode_generate_source_open(
                error = mv_engine_config_get_string_attribute(engine_cfg, "MV_BARCODE_GENERATE_ATTR_COLOR_BACK", &bgcolour);
                if (error != MEDIA_VISION_ERROR_NONE) {
                        if (bgcolour) {
-                               delete [] bgcolour;
+                               free(bgcolour);
                                bgcolour = NULL;
                        }
 
                        if (fgcolour) {
-                               delete [] fgcolour;
+                               free(fgcolour);
                                fgcolour = NULL;
                        }
 
@@ -301,12 +301,12 @@ int mv_barcode_generate_source_open(
                                        bgcolour);
 
        if (fgcolour != NULL) {
-               delete [] fgcolour;
+               free(fgcolour);
                fgcolour = NULL;
        }
 
        if (bgcolour != NULL) {
-               delete [] bgcolour;
+               free(bgcolour);
                bgcolour = NULL;
        }
 
@@ -403,7 +403,7 @@ int mv_barcode_generate_image_open(
                error = mv_engine_config_get_string_attribute(engine_cfg, "MV_BARCODE_GENERATE_ATTR_COLOR_FRONT", &fgcolour);
                if (error != MEDIA_VISION_ERROR_NONE) {
                        if (fgcolour) {
-                               delete [] fgcolour;
+                               free(fgcolour);
                                fgcolour = NULL;
                        }
 
@@ -414,12 +414,12 @@ int mv_barcode_generate_image_open(
                error = mv_engine_config_get_string_attribute(engine_cfg, "MV_BARCODE_GENERATE_ATTR_COLOR_BACK", &bgcolour);
                if (error != MEDIA_VISION_ERROR_NONE) {
                        if (bgcolour) {
-                               delete [] bgcolour;
+                               free(bgcolour);
                                bgcolour = NULL;
                        }
 
                        if (fgcolour) {
-                               delete [] fgcolour;
+                               free(fgcolour);
                                fgcolour = NULL;
                        }
 
@@ -464,12 +464,12 @@ int mv_barcode_generate_image_open(
                                                        bgcolour);
 
        if (fgcolour != NULL) {
-               delete [] fgcolour;
+               free(fgcolour);
                fgcolour = NULL;
        }
 
        if (bgcolour != NULL) {
-               delete [] bgcolour;
+               free(bgcolour);
                bgcolour = NULL;
        }
 
index 07e07df..f1a70ec 100644 (file)
@@ -100,7 +100,8 @@ int mv_face_detect_open(
                LOGI("Haarcascade file was set as default");
                haarcascadeFilePathStr = std::string(haarcascadeFilepath);
 
-               delete[] haarcascadeFilepath;
+               free(haarcascadeFilepath);
+               haarcascadeFilepath = NULL;
        } else {
                LOGE("Error occurred during face detection haarcascade file receiving."
                                " (%i)", error);
index c5dd126..f99c78a 100644 (file)
@@ -174,14 +174,18 @@ int EventTriggerPersonRecognition::parseEngineConfig(mv_engine_config_h engineCo
                LOGE("Failed to load face recognition model. Check %s attribute of the "
                                "engine config.", MV_SURVEILLANCE_FACE_RECOGNITION_MODEL_FILE_PATH);
 
-               if (modelPath != NULL)
-                       delete[] modelPath;
+               if (modelPath != NULL) {
+                       free(modelPath);
+                       modelPath = NULL;
+               }
 
                return MEDIA_VISION_ERROR_INVALID_PARAMETER;
        }
 
-       if (modelPath != NULL)
-               delete[] modelPath;
+       if (modelPath != NULL) {
+               free(modelPath);
+               modelPath = NULL;
+       }
 
        return MEDIA_VISION_ERROR_NONE;
 }
index 12729c8..cd8360a 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.3.18
+Version:     0.3.19
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-2.0