mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-07-15 19:41:07 +08:00
Fix a couple of leaks
This commit is contained in:
parent
f33a9564d1
commit
76c5cfe8c2
@ -1,3 +1,7 @@
|
|||||||
|
Sun Mar 13 15:22:11 CST 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
|
* src/util/mdb-export.c:
|
||||||
|
* src/util/mdb-ver.c: Fix a couple of leaks
|
||||||
|
|
||||||
Sat Mar 12 23:25:48 CST 2005 Jeff Smith <whydoubt@yahoo.com>
|
Sat Mar 12 23:25:48 CST 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* include/mdbtools.h:
|
* include/mdbtools.h:
|
||||||
* src/libmdb/file.c:
|
* src/libmdb/file.c:
|
||||||
|
@ -53,9 +53,8 @@ main(int argc, char **argv)
|
|||||||
MdbHandle *mdb;
|
MdbHandle *mdb;
|
||||||
MdbTableDef *table;
|
MdbTableDef *table;
|
||||||
MdbColumn *col;
|
MdbColumn *col;
|
||||||
/* doesn't handle tables > 256 columns. Can that happen? */
|
char **bound_values;
|
||||||
char *bound_values[256];
|
int *bound_lens;
|
||||||
int bound_lens[256];
|
|
||||||
char *delimiter = NULL;
|
char *delimiter = NULL;
|
||||||
char *row_delimiter = NULL;
|
char *row_delimiter = NULL;
|
||||||
char header_row = 1;
|
char header_row = 1;
|
||||||
@ -113,6 +112,8 @@ main(int argc, char **argv)
|
|||||||
fprintf(stderr," -I INSERT statements (instead of CSV)\n");
|
fprintf(stderr," -I INSERT statements (instead of CSV)\n");
|
||||||
fprintf(stderr," -D <format> set the date format (see strftime(3) for details)\n");
|
fprintf(stderr," -D <format> set the date format (see strftime(3) for details)\n");
|
||||||
fprintf(stderr," -S Sanitize names (replace spaces etc. with underscore)\n");
|
fprintf(stderr," -S Sanitize names (replace spaces etc. with underscore)\n");
|
||||||
|
g_free (delimiter);
|
||||||
|
g_free (row_delimiter);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +138,8 @@ main(int argc, char **argv)
|
|||||||
mdb_read_columns(table);
|
mdb_read_columns(table);
|
||||||
mdb_rewind_table(table);
|
mdb_rewind_table(table);
|
||||||
|
|
||||||
|
bound_values = (char **) g_malloc(table->num_cols * sizeof(char *));
|
||||||
|
bound_lens = (int *) g_malloc(table->num_cols * sizeof(int));
|
||||||
for (j=0;j<table->num_cols;j++) {
|
for (j=0;j<table->num_cols;j++) {
|
||||||
bound_values[j] = (char *) g_malloc0(MDB_BIND_SIZE);
|
bound_values[j] = (char *) g_malloc0(MDB_BIND_SIZE);
|
||||||
mdb_bind_column(table, j+1, bound_values[j], &bound_lens[j]);
|
mdb_bind_column(table, j+1, bound_values[j], &bound_lens[j]);
|
||||||
@ -185,6 +188,8 @@ main(int argc, char **argv)
|
|||||||
for (j=0;j<table->num_cols;j++) {
|
for (j=0;j<table->num_cols;j++) {
|
||||||
g_free(bound_values[j]);
|
g_free(bound_values[j]);
|
||||||
}
|
}
|
||||||
|
g_free(bound_values);
|
||||||
|
g_free(bound_lens);
|
||||||
mdb_free_tabledef(table);
|
mdb_free_tabledef(table);
|
||||||
|
|
||||||
g_free (delimiter);
|
g_free (delimiter);
|
||||||
|
@ -64,6 +64,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (!(mdb = mdb_open(argv[optind], MDB_NOFLAGS))) {
|
if (!(mdb = mdb_open(argv[optind], MDB_NOFLAGS))) {
|
||||||
fprintf(stderr,_("Error: unable to open file %s\n"),argv[optind]);
|
fprintf(stderr,_("Error: unable to open file %s\n"),argv[optind]);
|
||||||
|
mdb_exit();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (IS_JET3(mdb)) {
|
if (IS_JET3(mdb)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user