} \
} while (0)
+#define SAFE_FREE_CUSTOM(X, Y) if (NULL != (X)) \
+ { \
+ Y((X)); \
+ (X) = NULL; \
+ }
+#define SAFE_FREE(X) SAFE_FREE_CUSTOM(X, free)
+
#ifdef __cplusplus
}
#endif /*__cplusplus */
static char res_folder_path[PATH_MAX] = {'\0'};
if (res_folder_path[0] == '\0') {
char *resource_path_buf = app_get_resource_path();
+ if (NULL != resource_path_buf) {
strncpy(res_folder_path, resource_path_buf, PATH_MAX-1);
- free(resource_path_buf);
+ }
+ SAFE_FREE(resource_path_buf);
}
return res_folder_path;
}
if (value != NULL && !strcmp(value, "GenerateAdId")) {
char *adid = vconf_get_str(VCONFKEY_SETAPPL_AD_ID);
- if (!strcmp(adid, DEFAULT_ID)) {
+ if ((NULL != adid) && (!strcmp(adid, DEFAULT_ID))) {
make_ad_id();
vconf_set_int(VCONFKEY_SETAPPL_AD_ID_OPT_OUT, 0);
}
+ SAFE_FREE(adid);
} else {
create_base_gui(ad);
}