Replace malloc/free with g_malloc/g_free

This commit is contained in:
whydoubt
2004-12-31 05:25:11 +00:00
parent 680e997365
commit f09f9438d3
9 changed files with 27 additions and 25 deletions

View File

@@ -819,11 +819,11 @@ GtkTreeIter *node, *container;
int namelen;
namelen = fbuf[newbase];
tmpstr = malloc(namelen + 1);
tmpstr = g_malloc(namelen + 1);
strncpy(tmpstr, &fbuf[newbase+1], namelen);
tmpstr[namelen]=0;
snprintf(str, 100, "Column %d: %s", i+1, tmpstr);
free(tmpstr);
g_free(tmpstr);
node = gmdb_debug_add_item(store, container, str, newbase + 1, newbase + namelen);
newbase += namelen + 1;
}
@@ -847,12 +847,12 @@ GtkTreeIter *node, *container;
int namelen;
namelen = fbuf[newbase];
tmpstr = malloc(namelen + 1);
tmpstr = g_malloc(namelen + 1);
strncpy(tmpstr, &fbuf[newbase+1], namelen);
tmpstr[namelen]=0;
snprintf(str, 100, "Index %d: %s", i+1, tmpstr);
node = gmdb_debug_add_item(store, container, str, newbase+1, newbase+namelen);
free(tmpstr);
g_free(tmpstr);
newbase += namelen + 1;
}
}