g_strstrip(host);
conf->host[host_idx] = strdup(host);
LOGD("host: %s", conf->host[host_idx]);
- key = (char *)malloc(MUSE_MSG_LEN_MAX);
- if (!key) {
- LOGE("Error - null key");
- goto out;
- }
+ key = (char *)g_malloc0(MUSE_MSG_LEN_MAX);
conf->host_infos[host_idx] = (host_info_t *) calloc(1, sizeof(host_info_t));
if (!conf->host_infos[host_idx]) {
host = strtok_r(NULL, INI_PARSER_COMMA, &ptr);
conf->host_cnt++;
- free(key);
+ g_free(key);
}
free(hosts);
gst_param_cnt = ms_config_get_gst_param_cnt();
- argc = malloc(sizeof(gint));
- muse_return_if_fail(argc);
+ argc = g_malloc0(sizeof(gint));
/* add gst_param */
- argv = malloc(sizeof(gchar *) * (gst_param_cnt + 1));
- if (!argv) {
- LOGE("argv memory leak allocation failed");
- free(argc);
- return;
- }
-
- memset(argv, 0, sizeof(gchar *) * (gst_param_cnt + 1));
+ argv = g_malloc0(sizeof(gchar *) * (gst_param_cnt + 1));
- *argc = 0;
argv[*argc] = (gchar *)cmd[0];
(*argc)++;
for (; (*argc) <= gst_param_cnt; (*argc)++)
LOGI("gst_init_check is completed");
/* release */
- free(argv);
- free(argc);
+ g_free(argv);
+ g_free(argc);
LOGI("complete to initialize gstreamer");
file_size = ftell(fp);
fseek(fp, 0, SEEK_SET);
- tbuf = (gchar*)g_malloc0(file_size);
- if (!tbuf) {
- LOGE("Memory allocation failed");
- goto error;
- }
+ tbuf = (gchar *)g_malloc0(file_size);
if (!fgets(tbuf, file_size, fp)) {
LOGE("Read error");