Skip to content

Commit 43db0c8

Browse files
authored
v.generalize: Fix Resource Leak Issue in misc.c (OSGeo#6176)
1 parent d0e1472 commit 43db0c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vector/v.generalize/misc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ int copy_tables_by_cats(struct Map_info *In, struct Map_info *Out)
144144
}
145145
if (f >= 0 && nocats[f] > 0)
146146
ntabs++;
147+
Vect_destroy_field_info(IFi);
147148
}
148149

149150
if (ntabs > 1)
@@ -183,13 +184,16 @@ int copy_tables_by_cats(struct Map_info *In, struct Map_info *Out)
183184
Vect_map_add_dblink(Out, OFi->number, OFi->name, OFi->table,
184185
IFi->key, OFi->database, OFi->driver);
185186
}
187+
Vect_destroy_field_info(OFi);
188+
Vect_destroy_field_info(IFi);
186189
}
187190

188191
for (i = 0; i < nfields; i++)
189192
G_free(ocats[i]);
190193
G_free(ocats);
191194
G_free(nocats);
192195
G_free(fields);
196+
Vect_destroy_cats_struct(Cats);
193197
return 1;
194198
}
195199

0 commit comments

Comments
 (0)