Skip to content

Commit 037060f

Browse files
authored
r.fill.dir: Fix Resource Leak Issue in dopolys.c and filldir.c (OSGeo#6358)
* Fix Resource Leak Issue * Update raster/r.fill.dir/dopolys.c
1 parent 2a59380 commit 037060f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

raster/r.fill.dir/dopolys.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ int dopolys(int fd, int fm, int nl, int ns)
7171
}
7272
}
7373
}
74-
if (found == 0)
74+
if (found == 0) {
75+
G_free(cells);
76+
G_free(dir);
7577
return 0;
76-
78+
}
7779
/* Loop through the list, assigning polygon numbers to unassigned entries
7880
and carrying the same assignment over to adjacent cells. Repeat
7981
recursively */

raster/r.fill.dir/filldir.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ void check(CELL newdir, CELL *dir, void *center, void *edge, double cnst,
3939
int fill_row(int nl UNUSED, int ns, struct band3 *bnd)
4040
{
4141
int j, offset, inc, rc;
42-
void *min;
42+
char *min;
4343
char *center;
4444
char *edge;
4545

4646
inc = bpe();
4747

48-
min = G_malloc(bpe());
49-
5048
rc = 0;
5149
for (j = 1; j < ns - 1; j += 1) {
5250
offset = j * bpe();

0 commit comments

Comments
 (0)