[cause]
- allocate memory using operator new[]
- deallocate the memory using free()
- it may cause memory corruption or undefined behaviors
[solve]
- replace operator new[] with malloc()
Change-Id: Icc844a98fda28556b071e62ad2599bacba441974
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
#include <mv_private.h>
#include <string.h>
+#include <stdlib.h>
#include <media_packet.h>
int mv_create_source_c(
LOGD("Convert string to char*");
int stringSize = attributeValue.size();
- (*value) = new char[stringSize + 1];
+ (*value) = (char *)malloc(sizeof(char) * (stringSize + 1));
if (attributeValue.copy(*value, stringSize) != attributeValue.size()) {
LOGE("Conversion from string to char* failed");
- delete[] (*value);
+ free(*value);
(*value) = NULL;
return MEDIA_VISION_ERROR_INVALID_OPERATION;
}
Name: capi-media-vision
Summary: Media Vision library for Tizen Native API
-Version: 0.3.16
+Version: 0.3.17
Release: 1
Group: Multimedia/Framework
License: Apache-2.0 and BSD-2.0