summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhyunho <hhstark.kang@samsung.com>2020-09-11 16:35:21 +0900
committerhyunho <hhstark.kang@samsung.com>2020-09-11 16:35:33 +0900
commit8e8c66fa39d5300a33615d601d98fb7ff9f1e118 (patch)
tree1b72671840c8de3d030ef5a71707d4973502b0f2
parent4bda5be4e68ac38af1f07a36f40604e8c1555111 (diff)
downloadappcore-watch-8e8c66fa39d5300a33615d601d98fb7ff9f1e118.tar.gz
appcore-watch-8e8c66fa39d5300a33615d601d98fb7ff9f1e118.tar.bz2
appcore-watch-8e8c66fa39d5300a33615d601d98fb7ff9f1e118.zip
Fix memory leak
Change-Id: I22e9b46c0e79252fdd57dad357b8d335efd68681 Signed-off-by: hyunho <hhstark.kang@samsung.com>
-rwxr-xr-xsrc/base/watch_base.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/base/watch_base.c b/src/base/watch_base.c
index 73b4beb..8b8bb26 100755
--- a/src/base/watch_base.c
+++ b/src/base/watch_base.c
@@ -586,6 +586,8 @@ int __on_change_signal(const char *endpoint, aul_app_com_result_e e,
_E("mode is nullptr");
return 0;
}
+ if (__context.extra)
+ bundle_free(__context.extra);
__context.extra = bundle_decode((bundle_raw *)extra, strlen(extra));
__handling_ambient_mode(atoi(mode), NULL);
@@ -616,8 +618,10 @@ static void __unset_ambient_changed_cb()
__context.conn = NULL;
}
- if (__context.extra)
+ if (__context.extra) {
bundle_free(__context.extra);
+ __context.extra = NULL;
+ }
}
static int __on_ui_base_create(void *data)
@@ -1066,6 +1070,8 @@ EXPORT_API int watch_base_init(int argc, char **argv,
__context.ambient_mode_skip_resume = false;
__context.data = user_data;
__context.state = WATCH_BASE_STATE_CREATING;
+ if (__context.extra)
+ bundle_free(__context.extra);
__context.extra = NULL;
return appcore_ui_base_init(ops, argc, argv, NULL, 0);