Skip to content

Commit

Permalink
fixes map pointer issue
Browse files Browse the repository at this point in the history
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
  • Loading branch information
NishantBansal2003 committed Oct 25, 2024
1 parent cfc23bf commit 926abad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vector/v.info/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void print_columns(struct Map_info *Map, const char *input_opt,
num_dblinks = Vect_get_num_dblinks(Map);

if (num_dblinks <= 0) {
Vect_close(&Map);
Vect_close(Map);
G_fatal_error(
_("Database connection for map <%s> is not defined in DB file"),
input_opt);
Expand All @@ -200,21 +200,21 @@ void print_columns(struct Map_info *Map, const char *input_opt,
field_opt);

if ((fi = Vect_get_field2(Map, field_opt)) == NULL) {
Vect_close(&Map);
Vect_close(Map);
G_fatal_error(
_("Database connection not defined for layer <%s> of <%s>"),
field_opt, input_opt);
}
driver = db_start_driver(fi->driver);
if (driver == NULL) {
Vect_close(&Map);
Vect_close(Map);
G_fatal_error(_("Unable to open driver <%s>"), fi->driver);
}
db_init_handle(&handle);
db_set_handle(&handle, fi->database, NULL);
if (db_open_database(driver, &handle) != DB_OK) {
db_shutdown_driver(driver);
Vect_close(&Map);
Vect_close(Map);
G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
fi->database, fi->driver);
}
Expand All @@ -223,7 +223,7 @@ void print_columns(struct Map_info *Map, const char *input_opt,
if (db_describe_table(driver, &table_name, &table) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
Vect_close(&Map);
Vect_close(Map);
G_fatal_error(_("Unable to describe table <%s>"), fi->table);
}

Expand Down Expand Up @@ -277,7 +277,7 @@ void print_columns(struct Map_info *Map, const char *input_opt,
json_value_free(root_value);
db_close_database(driver);
db_shutdown_driver(driver);
Vect_close(&Map);
Vect_close(Map);
G_fatal_error(_("Failed to initialize pretty JSON string."));
}
puts(serialized_string);
Expand Down

0 comments on commit 926abad

Please sign in to comment.