app_state = app_context_get_app_status(aul_app_context->status);
retrieval_context->pid = aul_app_context->pid;
- retrieval_context->pkg_id = aul_app_context->pkgid;
+ retrieval_context->pkg_id = strdup(aul_app_context->pkgid);
retrieval_context->app_state = app_state;
if (aul_app_context->is_sub_app)
retrieval_context->is_sub_app = true;
int app_context_get_app_context(const char *app_id, app_context_h *app_context)
{
+ int ret;
retrieval_context_s retrieval_context = {
.app_id = app_id,
.pid = 0,
if (retrieval_context.matched == false)
return app_manager_error(APP_MANAGER_ERROR_NO_SUCH_APP, __FUNCTION__, NULL);
-
- return app_context_create(retrieval_context.app_id,
+ ret = app_context_create(retrieval_context.app_id,
retrieval_context.pid,
retrieval_context.pkg_id,
retrieval_context.app_state,
retrieval_context.is_sub_app,
app_context);
+ free(retrieval_context.pkg_id);
+
+ return ret;
}
static int app_context_create(const char *app_id, pid_t pid, const char *pkg_id, app_state_e app_state, bool is_sub_app, app_context_h *app_context)