Skip to content

Commit

Permalink
Fix Resource Leak Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Vasudeo Desai committed Feb 19, 2025
1 parent ea470fa commit 2111d74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vector/v.vol.rst/user1.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ int INPUT(struct Map_info *In, char *column, char *scol, char *wheresql)
G_warning(_("Can't insert %lf,%lf,%lf,%lf,%lf a=%d"), x, y, z,
w, sm, a);
Vect_destroy_field_info(Fi);
db_close_database_shutdown_driver(Driver);
db_CatValArray_free(&cvarr);
return -1;
}

Expand Down Expand Up @@ -324,6 +326,7 @@ int INPUT(struct Map_info *In, char *column, char *scol, char *wheresql)
else {
fprintf(stderr, "ERROR: zero points in the given region!\n");
Vect_destroy_field_info(Fi);
db_close_database_shutdown_driver(Driver);
return -1;
}
}
Expand All @@ -335,6 +338,7 @@ int INPUT(struct Map_info *In, char *column, char *scol, char *wheresql)
fprintf(stderr, "for smooth connection of segments, npmin > segmax "
"(see manual) \n");
Vect_destroy_field_info(Fi);
db_close_database_shutdown_driver(Driver);
return -1;
}

Expand Down Expand Up @@ -386,6 +390,7 @@ int INPUT(struct Map_info *In, char *column, char *scol, char *wheresql)
G_message(_("Bitmap mask created"));
}
Vect_destroy_field_info(Fi);
db_close_database_shutdown_driver(Driver);

return 1;
}
Expand Down

0 comments on commit 2111d74

Please sign in to comment.