int result = 0;
if (overwrite || !getenv(name)) {
size_t length = strlen(name) + strlen(value) + 2;
- char *string = qemu_malloc(length);
+ char *string = g_malloc(length);
snprintf(string, length, "%s=%s", name, value);
result = putenv(string);
}
int qemu_add_polling_cb(PollingFunc *func, void *opaque)
{
PollingEntry **ppe, *pe;
- pe = qemu_mallocz(sizeof(PollingEntry));
+ pe = g_malloc0(sizeof(PollingEntry));
pe->func = func;
pe->opaque = opaque;
for(ppe = &first_polling_entry; *ppe != NULL; ppe = &(*ppe)->next);
pe = *ppe;
if (pe->func == func && pe->opaque == opaque) {
*ppe = pe->next;
- qemu_free(pe);
+ g_free(pe);
break;
}
}
p--;
*p = 0;
if (access(buf, R_OK) == 0) {
- return qemu_strdup(buf);
+ return g_strdup(buf);
}
return NULL;
}