}
}
-static inline void _set_str_with_default(keynode_t* node, const char *def, char *target)
+static inline void _set_str_with_default(keynode_t* node, const char *def, char **target)
{
const char *key_str = vconf_keynode_get_str(node);
char *str = NULL;
if (!str)
_E("failed to strdup, keep old one");
- free(target);
- target = str;
+ free(*target);
+ *target = str;
+
+ _D("Target string is %s", *target);
}
static void _pm_state_cb(keynode_t* node, void *data)
char *fallback_pkg = vconf_get_str(VCONFKEY_STARTER_FALLBACK_PKG);
_set_str_with_default(node, fallback_pkg,
- s_status_active.setappl_selected_package_name);
+ &s_status_active.setappl_selected_package_name);
if (!s_status_active.setappl_selected_package_name)
_E("Package name is NULL");
{
ret_if(!node);
_set_str_with_default(node, STATUS_DEFAULT_LOCK_PKG_NAME,
- s_status_passive.setappl_3rd_lock_pkg_name_str);
+ &s_status_passive.setappl_3rd_lock_pkg_name_str);
if (!s_status_passive.setappl_3rd_lock_pkg_name_str)
_E("Package name is NULL");
}