Fix wrong implementation 86/216486/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 25 Oct 2019 09:59:58 +0000 (18:59 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 25 Oct 2019 10:02:43 +0000 (19:02 +0900)
- Duplicates output data

Change-Id: I2fdb955544b4cfa7b9a94144c71c3308877e739a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/rua_info.c

index f194256..372e4ab 100644 (file)
@@ -773,7 +773,7 @@ API int rua_info_get_uri(rua_info_h info, char **uri)
        }
 
        if (info->value[RUA_INFO_URI]) {
-               *uri = info->value[RUA_INFO_URI];
+               *uri = strdup(info->value[RUA_INFO_URI]);
                if (*uri == NULL) {
                        _E("Out of memory");
                        return RUA_ERROR_OUT_OF_MEMORY;
@@ -793,7 +793,7 @@ API int rua_info_get_image(rua_info_h info, char **image)
        }
 
        if (info->value[RUA_INFO_IMAGE]) {
-               *image = info->value[RUA_INFO_IMAGE];
+               *image = strdup(info->value[RUA_INFO_IMAGE]);
                if (*image == NULL) {
                        _E("Out of memory");
                        return RUA_ERROR_OUT_OF_MEMORY;
@@ -813,7 +813,7 @@ API int rua_info_get_component_id(rua_info_h info, char **component_id)
        }
 
        if (info->value[RUA_INFO_COMPONENT_ID]) {
-               *component_id = info->value[RUA_INFO_COMPONENT_ID];
+               *component_id = strdup(info->value[RUA_INFO_COMPONENT_ID]);
                if (*component_id == NULL) {
                        _E("Out of memory");
                        return RUA_ERROR_OUT_OF_MEMORY;