better utilize glib functions, fix memory leaks

This commit is contained in:
whydoubt
2004-05-30 07:19:22 +00:00
parent 59f221b2b2
commit a5afa5c9e4
9 changed files with 67 additions and 47 deletions

View File

@@ -55,8 +55,7 @@ int opt;
while ((opt=getopt(argc, argv, "T:"))!=-1) {
switch (opt) {
case 'T':
tabname = (char *) malloc(strlen(optarg)+1);
strcpy(tabname, optarg);
tabname = (char *) g_strdup(optarg);
break;
}
}
@@ -101,6 +100,7 @@ int opt;
}
}
g_free(tabname);
mdb_close (mdb);
mdb_exit();