iteration_next = foreach_context->callback(info, foreach_context->user_data);
- if (info->app_id) {
- free(info->app_id);
- info->app_id = NULL;
- }
-
- if (info) {
- free(info);
- info = NULL;
- }
+ free(info->app_id);
+ free(info);
if (iteration_next == true)
return PMINFO_R_OK;
- else
- return PMINFO_R_ERROR;
+
+ return PMINFO_R_ERROR;
}
static int app_info_foreach_app_metadata_cb(const char *metadata_key, const char *metadata_value, void *user_data)
iteration_next = foreach_context->callback(metadata_key, metadata_value, foreach_context->user_data);
if (iteration_next == true)
return PMINFO_R_OK;
- else
- return PMINFO_R_ERROR;
+
+ return PMINFO_R_ERROR;
}
static int app_info_foreach_category_cb(const char *category_name, void *user_data)
iteration_next = foreach_category->callback(category_name, foreach_category->user_data);
if (iteration_next == true)
return PMINFO_R_OK;
- else
- return PMINFO_R_ERROR;
+
+ return PMINFO_R_ERROR;
}
static int app_info_foreach_app_info_cb(pkgmgrinfo_appinfo_h handle, void *cb_data)
if (iteration_next == true)
return PMINFO_R_OK;
- else
- return PMINFO_R_ERROR;
+
+ return PMINFO_R_ERROR;
}
int app_info_foreach_app_info(app_manager_app_info_cb callback, void *user_data)
cynara *p_cynara;
int fd;
int ret;
-
char client[SMACK_LABEL_LEN + 1] = {0,};
char uid[10] = {0,};
char *client_session = "";
if (app_info == NULL)
return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
- if (app_info->app_id) {
+ if (app_info->app_id)
free(app_info->app_id);
- app_info->app_id = NULL;
- }
pkgmgrinfo_appinfo_destroy_appinfo(app_info->pkg_app_info);
free(app_info);
API int app_info_get_localed_label(const char *app_id, const char *locale, char **label)
{
char *val = NULL;
- char *app_label_dup = NULL;
if (app_id == NULL || locale == NULL || label == NULL)
return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
if (pkgmgrinfo_appinfo_usr_get_localed_label(app_id, locale, getuid(), &val))
return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
- app_label_dup = strdup(val);
- if (app_label_dup == NULL) {
- /* LCOV_EXCL_START */
- if (val) {
- free(val);
- val = NULL;
- }
- return app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
- /* LCOV_EXCL_STOP */
- }
-
- *label = app_label_dup;
- free(val);
+ *label = val;
return APP_MANAGER_ERROR_NONE;
}